Commit 8e8ce1e9 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Reland "Update paint/invalidation/repaint-overlay/layers-overlay.html"

This is a reland of f01abd36

The original patch failed on Windows bots because there was no
"/tmp" directory. This new patch saves the generated layers-overlay.html
in the results directory (existence ensured).

Original change's description:
> Update paint/invalidation/repaint-overlay/layers-overlay.html
>
> It is generated by a python test case
> (TestRepaintOverlay.test_generate_repaint_overlay_html).
> I should have updated it when changing repaint_overlay.py.
>
> Updated the test to fail and print a message if the file needs an
> update.
>
> Bug: 789272
> Change-Id: I2e6ba6573788177dfbc09d2bd4d3d80023d4b21f
> Reviewed-on: https://chromium-review.googlesource.com/794875
> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
> Reviewed-by: Philip Rogers <pdr@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#519912}

TBR=pdr@chromium.org

Bug: 789272
Change-Id: I17de00b123520be148bba4aacd923f21d3f18e9c
Reviewed-on: https://chromium-review.googlesource.com/797110Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520171}
parent d359bae0
<!DOCTYPE HTML>
<body style="margin: 0">
<label><input type="checkbox" checked>Show test</label>
<label><input type="checkbox">Show test</label>
<label><input type="checkbox">Use solid colors</label>
<br>
<span>Expected Invalidations</span>
......
......@@ -19,6 +19,7 @@
width: 800px;
height: 600px;
border: 0;
display: none;
}
canvas {
position: absolute;
......@@ -29,7 +30,7 @@
</style>
</head>
<body>
<label><input id="show-test" type="checkbox" checked onchange="toggle_test(this.checked)">Show test</label>
<label><input id="show-test" type="checkbox" onchange="toggle_test(this.checked)">Show test</label>
<label><input id="use-solid-colors" type="checkbox" onchange="toggle_solid_color(this.checked)">Use solid colors</label>
<br>
<span id="overlay_type">Expected Invalidations</span>
......@@ -43,6 +44,8 @@ var overlay_opacity = 0.25;
function toggle_test(show_test) {
test_frame.style.display = show_test ? 'block' : 'none';
if (!test_frame.src)
test_frame.src = decodeURIComponent(location.search).substr(1);
}
function toggle_solid_color(use_solid_color) {
......@@ -381,8 +384,6 @@ function draw_repaint_rects() {
draw_repaint_rects();
test_frame.src = decodeURIComponent(location.search).substr(1);
var expected_showing = true;
function flip() {
if (expected_showing) {
......@@ -396,7 +397,7 @@ function flip() {
}
expected_showing = !expected_showing
}
setInterval(flip, 3000);
setInterval(flip, 1500);
</script>
</body>
</html>
......@@ -63,7 +63,20 @@ class TestRepaintOverlay(unittest.TestCase):
'<!-- Generated by Tools/Scripts/test-webkitpy\n' +
' test case: TestRepaintOverlay.test_generate_repaint_overlay_html. -->\n' +
repaint_overlay.generate_repaint_overlay_html(test_name, layer_tree, layer_tree))
overlay_html_test_name = 'paint/invalidation/repaint-overlay/layers-overlay.html'
overlay_html_file = port.abspath_for_test(overlay_html_test_name)
host.filesystem.write_text_file(overlay_html_file, overlay_html)
# The correctness of overlay html will be tested as a layout test.
results_directory = port.results_directory()
host.filesystem.maybe_make_directory(results_directory)
actual_overlay_html_file = host.filesystem.join(results_directory, 'layers-overlay.html')
host.filesystem.write_text_file(actual_overlay_html_file, overlay_html)
overlay_html_file = port.abspath_for_test('paint/invalidation/repaint-overlay/layers-overlay.html')
expected = host.filesystem.read_text_file(overlay_html_file)
self.assertEquals(
expected, overlay_html,
'This failure is probably caused by changed repaint_overlay.py. '
'Please examine the diffs:\n diff %s %s\n'
'If the diffs are valid, update the file:\n cp %s %s\n'
'then update layers-overlay-expected.html in the same directory if needed,'
' and commit the files together with the changed repaint_overlay.py.' %
(overlay_html_file, actual_overlay_html_file, actual_overlay_html_file, overlay_html_file))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment