OLD | NEW |
1 // Asynchronous tests should manually call finishRepaintTest at the appropriate | 1 // Asynchronous tests should manually call finishRepaintTest at the appropriate |
2 // time. | 2 // time. |
3 window.testIsAsync = false; | 3 window.testIsAsync = false; |
4 window.outputRepaintRects = true; | 4 window.outputRepaintRects = true; |
5 window.generateMinimumRepaint = false; // See comments about 'Minimum repaint' b
elow. | 5 window.generateMinimumRepaint = false; // See comments about 'Minimum repaint' b
elow. |
6 | 6 |
7 // All repaint tests are asynchronous. | 7 // All repaint tests are asynchronous. |
8 if (window.testRunner) | 8 if (window.testRunner) |
9 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
10 | 10 |
11 function runRepaintTest() | 11 function runRepaintTest() |
12 { | 12 { |
13 if (!window.testRunner || !window.internals) { | 13 if (!window.testRunner || !window.internals) { |
14 setTimeout(repaintTest, 500); | 14 setTimeout(repaintTest, 500); |
15 return; | 15 return; |
16 } | 16 } |
17 | 17 |
18 // TODO(enne): this is a workaround for multiple svg onload events. | |
19 // See: http://crbug.com/372946 | |
20 if (window.hasRunRepaintTest) | |
21 return; | |
22 window.hasRunRepaintTest = true; | |
23 | |
24 if (window.enablePixelTesting) | 18 if (window.enablePixelTesting) |
25 testRunner.dumpAsTextWithPixelResults(); | 19 testRunner.dumpAsTextWithPixelResults(); |
26 else | 20 else |
27 testRunner.dumpAsText(); | 21 testRunner.dumpAsText(); |
28 | 22 |
29 function continueRepaintTest() | 23 function continueRepaintTest() |
30 { | 24 { |
31 window.internals.startTrackingRepaints(document); | 25 window.internals.startTrackingRepaints(document); |
32 repaintTest(); | 26 repaintTest(); |
33 if (!window.testIsAsync) | 27 if (!window.testIsAsync) |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 } else { | 181 } else { |
188 var newRect = [xBegin, y, xWidth, 1]; | 182 var newRect = [xBegin, y, xWidth, 1]; |
189 nextRectsMayContinue.push(newRect); | 183 nextRectsMayContinue.push(newRect); |
190 result.push(newRect); | 184 result.push(newRect); |
191 } | 185 } |
192 } | 186 } |
193 rectsMayContinue = nextRectsMayContinue; | 187 rectsMayContinue = nextRectsMayContinue; |
194 } | 188 } |
195 return result; | 189 return result; |
196 } | 190 } |
OLD | NEW |