Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/repaint/resources/window-resize-repaint.js

Issue 2058053002: Revert of Convert fast/repaint/window-resize*.html into reftests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 var testSizes = [ 1 var testSizes = [
2 { width: 600, height: 500 }, // initial size 2 { width: 200, height: 200 }, // initial size
3 { width: 600, height: 250 }, // height decrease 3 { width: 200, height: 300 }, // height increase
4 { width: 400, height: 250 }, // width decrease 4 { width: 300, height: 300 }, // width increase
5 { width: 400, height: 600 }, // height increase 5 { width: 300, height: 250 }, // height decrease
6 { width: 800, height: 600 } // width increase 6 { width: 250, height: 250 } // width decrease
7 // Tests can add more testSizes.
7 ]; 8 ];
8 9
9 var sizeIndex = 0; 10 var sizeIndex = 0;
10 var repaintRects = "";
11 11
12 if (window.internals) 12 function repaintTest() {
13 internals.settings.setUseDefaultImageInterpolationQuality(true); 13 window.resizeTo(testSizes[sizeIndex].width, testSizes[sizeIndex].height);
14 }
14 15
15 function doTest() { 16 if (window.internals) {
16 if (sizeIndex) { 17 internals.settings.setOverlayScrollbarsEnabled(true);
17 repaintRects += internals.layerTreeAsText(document, window.internals.LAY ER_TREE_INCLUDES_PAINT_INVALIDATIONS); 18 internals.settings.setMockScrollbarsEnabled(true);
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 }
29 } 19 }
30 20
31 if (window.testRunner) { 21 if (window.testRunner) {
32 testRunner.useUnfortunateSynchronousResizeMode(); 22 testRunner.useUnfortunateSynchronousResizeMode();
33 testRunner.waitUntilDone(); 23 testRunner.dumpAsText();
34 window.resizeTo(testSizes[0].width, testSizes[0].height); 24
35 testRunner.layoutAndPaintAsyncThen(doTest); 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 }
36 } 39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698