| 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 |
| 7 // Tests can add more testSizes. | |
| 8 ]; | 7 ]; |
| 9 | 8 |
| 10 var sizeIndex = 0; | 9 var sizeIndex = 0; |
| 10 var repaintRects = ""; |
| 11 | 11 |
| 12 function repaintTest() { | 12 if (window.internals) |
| 13 window.resizeTo(testSizes[sizeIndex].width, testSizes[sizeIndex].height); | 13 internals.settings.setUseDefaultImageInterpolationQuality(true); |
| 14 } | |
| 15 | 14 |
| 16 if (window.internals) { | 15 function doTest() { |
| 17 internals.settings.setOverlayScrollbarsEnabled(true); | 16 if (sizeIndex) { |
| 18 internals.settings.setMockScrollbarsEnabled(true); | 17 repaintRects += internals.layerTreeAsText(document, window.internals.LAY
ER_TREE_INCLUDES_PAINT_INVALIDATIONS); |
| 18 internals.stopTrackingRepaints(document); |
| 19 } |
| 20 ++sizeIndex; |
| 21 if (sizeIndex < testSizes.length) { |
| 22 internals.startTrackingRepaints(document); |
| 23 window.resizeTo(testSizes[sizeIndex].width, testSizes[sizeIndex].height)
; |
| 24 testRunner.layoutAndPaintAsyncThen(doTest); |
| 25 } else if (window.testRunner) { |
| 26 testRunner.setCustomTextOutput(repaintRects); |
| 27 testRunner.notifyDone(); |
| 28 } |
| 19 } | 29 } |
| 20 | 30 |
| 21 if (window.testRunner) { | 31 if (window.testRunner) { |
| 22 testRunner.useUnfortunateSynchronousResizeMode(); | 32 testRunner.useUnfortunateSynchronousResizeMode(); |
| 23 testRunner.dumpAsText(); | 33 testRunner.waitUntilDone(); |
| 24 | 34 window.resizeTo(testSizes[0].width, testSizes[0].height); |
| 25 window.onload = function() { | 35 testRunner.layoutAndPaintAsyncThen(doTest); |
| 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 } | 36 } |
| OLD | NEW |