Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 var testSizes = [ | 1 var testSizes = [ |
| 2 { width: 200, height: 200 }, // initial size | 2 { width: 600, height: 500 }, // initial size |
| 3 { width: 200, height: 300 }, // height increase | 3 { width: 600, height: 250 }, // height decrease |
| 4 { width: 300, height: 300 }, // width increase | 4 { width: 400, height: 250 }, // width decrease |
| 5 { width: 300, height: 250 }, // height decrease | 5 { width: 400, height: 600 }, // height increase |
| 6 { width: 250, height: 250 } // width decrease | 6 { 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
| |
| 7 // Tests can add more testSizes. | |
| 8 ]; | 7 ]; |
| 9 | 8 |
| 10 var sizeIndex = 0; | 9 var sizeIndex = 1; |
| 10 var repaintRects = ""; | |
| 11 | 11 |
| 12 function repaintTest() { | 12 function doTest() { |
| 13 window.resizeTo(testSizes[sizeIndex].width, testSizes[sizeIndex].height); | 13 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
| |
| 14 } | 14 repaintRects += internals.layerTreeAsText(document, window.internals.LAY ER_TREE_INCLUDES_PAINT_INVALIDATIONS); |
| 15 | 15 internals.stopTrackingRepaints(document); |
| 16 if (window.internals) { | 16 } |
| 17 internals.settings.setOverlayScrollbarsEnabled(true); | 17 if (sizeIndex < testSizes.length) { |
| 18 internals.settings.setMockScrollbarsEnabled(true); | 18 internals.startTrackingRepaints(document); |
| 19 window.resizeTo(testSizes[sizeIndex].width, testSizes[sizeIndex].height) ; | |
| 20 sizeIndex++; | |
| 21 testRunner.layoutAndPaintAsyncThen(doTest); | |
| 22 } else if (window.testRunner) { | |
| 23 testRunner.setCustomTextOutput(repaintRects); | |
| 24 testRunner.notifyDone(); | |
| 25 } | |
| 19 } | 26 } |
| 20 | 27 |
| 21 if (window.testRunner) { | 28 if (window.testRunner) { |
| 22 testRunner.useUnfortunateSynchronousResizeMode(); | 29 testRunner.useUnfortunateSynchronousResizeMode(); |
| 23 testRunner.dumpAsText(); | 30 testRunner.waitUntilDone(); |
| 31 window.resizeTo(testSizes[0].width, testSizes[0].height); | |
| 32 testRunner.layoutAndPaintAsyncThen(doTest); | |
| 33 } | |
| 24 | 34 |
| 25 window.onload = function() { | |
| 26 window.resizeTo(testSizes[0].width, testSizes[0].height); | |
| 27 | |
| 28 var repaintRects = ""; | |
| 29 for (sizeIndex = 1; sizeIndex < testSizes.length; ++sizeIndex) { | |
| 30 document.body.offsetTop; | |
| 31 internals.startTrackingRepaints(document); | |
| 32 repaintTest(); | |
| 33 document.body.offsetTop; | |
| 34 repaintRects += internals.layerTreeAsText(document, window.internals .LAYER_TREE_INCLUDES_PAINT_INVALIDATIONS); | |
| 35 internals.stopTrackingRepaints(document); | |
| 36 } | |
| 37 testRunner.setCustomTextOutput(repaintRects); | |
| 38 } | |
| 39 } | |
| OLD | NEW |