OLD | NEW |
1 // Asynchronous tests should manually call finishRepaintTest at the appropriate
time. | 1 // Asynchronous tests should manually call finishRepaintTest at the appropriate
time. |
2 window.testIsAsync = false; | 2 window.testIsAsync = false; |
3 window.outputRepaintRects = true; | 3 window.outputRepaintRects = true; |
4 | 4 |
5 if (window.internals) | 5 if (window.internals) |
6 window.internals.settings.setForceCompositingMode(true) | 6 window.internals.settings.setForceCompositingMode(true) |
7 | 7 |
8 function runRepaintTest() | 8 function runRepaintTest() |
9 { | 9 { |
10 if (!window.testRunner || !window.internals) { | 10 if (!window.testRunner || !window.internals) { |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 repaintTest(); | 27 repaintTest(); |
28 | 28 |
29 if (!window.testIsAsync) | 29 if (!window.testIsAsync) |
30 finishRepaintTest(); | 30 finishRepaintTest(); |
31 } | 31 } |
32 | 32 |
33 function runRepaintAndPixelTest() | 33 function runRepaintAndPixelTest() |
34 { | 34 { |
35 window.enablePixelTesting = true; | 35 window.enablePixelTesting = true; |
36 window.outputRepaintRects = false; | |
37 runRepaintTest(); | 36 runRepaintTest(); |
38 } | 37 } |
39 | 38 |
40 function forceStyleRecalc() | 39 function forceStyleRecalc() |
41 { | 40 { |
42 if (document.body) | 41 if (document.body) |
43 document.body.offsetTop; | 42 document.body.offsetTop; |
44 else if (document.documentElement) | 43 else if (document.documentElement) |
45 document.documentElement.offsetTop; | 44 document.documentElement.offsetTop; |
46 } | 45 } |
47 | 46 |
48 function finishRepaintTest() | 47 function finishRepaintTest() |
49 { | 48 { |
50 // Force a style recalc. | 49 // Force a style recalc. |
51 forceStyleRecalc(); | 50 forceStyleRecalc(); |
52 | 51 |
53 var repaintRects = window.internals.layerTreeAsText(document, window.interna
ls.LAYER_TREE_INCLUDES_REPAINT_RECTS); | 52 var repaintRects = window.internals.layerTreeAsText(document, window.interna
ls.LAYER_TREE_INCLUDES_REPAINT_RECTS); |
54 | 53 |
55 internals.stopTrackingRepaints(document); | 54 internals.stopTrackingRepaints(document); |
56 | 55 |
57 if (window.outputRepaintRects) | 56 if (window.outputRepaintRects) |
58 testRunner.setCustomTextOutput(repaintRects); | 57 testRunner.setCustomTextOutput(repaintRects); |
59 | 58 |
60 if (window.afterTest) | 59 if (window.afterTest) |
61 window.afterTest(); | 60 window.afterTest(); |
62 | 61 |
63 if (window.testIsAsync) | 62 if (window.testIsAsync) |
64 testRunner.notifyDone(); | 63 testRunner.notifyDone(); |
65 } | 64 } |
OLD | NEW |