Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/repaint/resources/window-resize-repaint.js |
| diff --git a/third_party/WebKit/LayoutTests/fast/repaint/resources/window-resize-repaint.js b/third_party/WebKit/LayoutTests/fast/repaint/resources/window-resize-repaint.js |
| index b4035369311ad888fde5b7c2e337023c58d2ee08..92ddc5aaf10cfc758c594d7a18d36f591a6ff7be 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/repaint/resources/window-resize-repaint.js |
| +++ b/third_party/WebKit/LayoutTests/fast/repaint/resources/window-resize-repaint.js |
| @@ -1,39 +1,34 @@ |
| var testSizes = [ |
| - { width: 200, height: 200 }, // initial size |
| - { width: 200, height: 300 }, // height increase |
| - { width: 300, height: 300 }, // width increase |
| - { width: 300, height: 250 }, // height decrease |
| - { width: 250, height: 250 } // width decrease |
| - // Tests can add more testSizes. |
| + { width: 600, height: 500 }, // initial size |
| + { width: 600, height: 250 }, // height decrease |
| + { width: 400, height: 250 }, // width decrease |
| + { width: 400, height: 600 }, // height increase |
| + { width: 800, height: 600 } // width increase |
|
Xianzhu
2016/06/07 17:18:10
The above changes have two purposes:
1. Use larger
pdr.
2016/06/07 22:44:46
Just FYI (this change is fine) that we run the W3C
|
| ]; |
| -var sizeIndex = 0; |
| +var sizeIndex = 1; |
| +var repaintRects = ""; |
| -function repaintTest() { |
| - window.resizeTo(testSizes[sizeIndex].width, testSizes[sizeIndex].height); |
| -} |
| - |
| -if (window.internals) { |
| - internals.settings.setOverlayScrollbarsEnabled(true); |
| - internals.settings.setMockScrollbarsEnabled(true); |
| +function doTest() { |
| + if (sizeIndex > 1) { |
|
pdr.
2016/06/07 22:44:46
Why do we only track repaint rects for sizeIndex 2
Xianzhu
2016/06/08 17:00:31
We increase sizeIndex just after resizeTo(), so wh
|
| + repaintRects += internals.layerTreeAsText(document, window.internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS); |
| + internals.stopTrackingRepaints(document); |
| + } |
| + if (sizeIndex < testSizes.length) { |
| + internals.startTrackingRepaints(document); |
| + window.resizeTo(testSizes[sizeIndex].width, testSizes[sizeIndex].height); |
| + sizeIndex++; |
| + testRunner.layoutAndPaintAsyncThen(doTest); |
| + } else if (window.testRunner) { |
| + testRunner.setCustomTextOutput(repaintRects); |
| + testRunner.notifyDone(); |
| + } |
| } |
| if (window.testRunner) { |
| testRunner.useUnfortunateSynchronousResizeMode(); |
| - testRunner.dumpAsText(); |
| - |
| - window.onload = function() { |
| - window.resizeTo(testSizes[0].width, testSizes[0].height); |
| - |
| - var repaintRects = ""; |
| - for (sizeIndex = 1; sizeIndex < testSizes.length; ++sizeIndex) { |
| - document.body.offsetTop; |
| - internals.startTrackingRepaints(document); |
| - repaintTest(); |
| - document.body.offsetTop; |
| - repaintRects += internals.layerTreeAsText(document, window.internals.LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS); |
| - internals.stopTrackingRepaints(document); |
| - } |
| - testRunner.setCustomTextOutput(repaintRects); |
| - } |
| + testRunner.waitUntilDone(); |
| + window.resizeTo(testSizes[0].width, testSizes[0].height); |
| + testRunner.layoutAndPaintAsyncThen(doTest); |
| } |
| + |