Commit f01abd36 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

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: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519912}
parent 7ab2c15c
<!DOCTYPE HTML> <!DOCTYPE HTML>
<body style="margin: 0"> <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> <label><input type="checkbox">Use solid colors</label>
<br> <br>
<span>Expected Invalidations</span> <span>Expected Invalidations</span>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
width: 800px; width: 800px;
height: 600px; height: 600px;
border: 0; border: 0;
display: none;
} }
canvas { canvas {
position: absolute; position: absolute;
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
</style> </style>
</head> </head>
<body> <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> <label><input id="use-solid-colors" type="checkbox" onchange="toggle_solid_color(this.checked)">Use solid colors</label>
<br> <br>
<span id="overlay_type">Expected Invalidations</span> <span id="overlay_type">Expected Invalidations</span>
...@@ -43,6 +44,8 @@ var overlay_opacity = 0.25; ...@@ -43,6 +44,8 @@ var overlay_opacity = 0.25;
function toggle_test(show_test) { function toggle_test(show_test) {
test_frame.style.display = show_test ? 'block' : 'none'; 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) { function toggle_solid_color(use_solid_color) {
...@@ -381,8 +384,6 @@ function draw_repaint_rects() { ...@@ -381,8 +384,6 @@ function draw_repaint_rects() {
draw_repaint_rects(); draw_repaint_rects();
test_frame.src = decodeURIComponent(location.search).substr(1);
var expected_showing = true; var expected_showing = true;
function flip() { function flip() {
if (expected_showing) { if (expected_showing) {
...@@ -396,7 +397,7 @@ function flip() { ...@@ -396,7 +397,7 @@ function flip() {
} }
expected_showing = !expected_showing expected_showing = !expected_showing
} }
setInterval(flip, 3000); setInterval(flip, 1500);
</script> </script>
</body> </body>
</html> </html>
...@@ -63,7 +63,16 @@ class TestRepaintOverlay(unittest.TestCase): ...@@ -63,7 +63,16 @@ class TestRepaintOverlay(unittest.TestCase):
'<!-- Generated by Tools/Scripts/test-webkitpy\n' + '<!-- Generated by Tools/Scripts/test-webkitpy\n' +
' test case: TestRepaintOverlay.test_generate_repaint_overlay_html. -->\n' + ' test case: TestRepaintOverlay.test_generate_repaint_overlay_html. -->\n' +
repaint_overlay.generate_repaint_overlay_html(test_name, layer_tree, layer_tree)) repaint_overlay.generate_repaint_overlay_html(test_name, layer_tree, layer_tree))
overlay_html_test_name = 'paint/invalidation/repaint-overlay/layers-overlay.html' host.filesystem.write_text_file('/tmp/layers-overlay.html', overlay_html)
overlay_html_file = port.abspath_for_test(overlay_html_test_name)
host.filesystem.write_text_file(overlay_html_file, overlay_html) overlay_html_file = port.abspath_for_test('paint/invalidation/repaint-overlay/layers-overlay.html')
# The correctness of overlay html will be tested as a layout test. 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 LayoutTests/paint/invalidation/repaint-overlay/layers-overlay.html /tmp/layers-overlay.html\n'
'If the diffs are valid, update the file:\n'
' cp /tmp/layers-overlay.html LayoutTests/paint/invalidation/repaint-overlay/layers-overlay.html\n'
'then update layers-overlay-expected.html in the same directory if needed,'
' and commit the changes together with the change of repaint_overlay.py.')
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