| 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 window.enablePixelTesting = true; |
| 6 | 7 |
| 7 // All repaint tests are asynchronous. | 8 // All repaint tests are asynchronous. |
| 8 if (window.testRunner) | 9 if (window.testRunner) |
| 9 testRunner.waitUntilDone(); | 10 testRunner.waitUntilDone(); |
| 10 | 11 |
| 11 function runRepaintTest() | 12 function runRepaintTest() |
| 12 { | 13 { |
| 13 if (!window.testRunner || !window.internals) { | 14 if (!window.testRunner || !window.internals) { |
| 14 setTimeout(repaintTest, 500); | 15 setTimeout(repaintTest, 500); |
| 15 return; | 16 return; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 39 window.widthBeforeRepaint = width; | 40 window.widthBeforeRepaint = width; |
| 40 window.heightBeforeRepaint = height; | 41 window.heightBeforeRepaint = height; |
| 41 window.snapshotBeforeRepaint = snapshot; | 42 window.snapshotBeforeRepaint = snapshot; |
| 42 continueRepaintTest(); | 43 continueRepaintTest(); |
| 43 }); | 44 }); |
| 44 } else { | 45 } else { |
| 45 testRunner.layoutAndPaintAsyncThen(continueRepaintTest); | 46 testRunner.layoutAndPaintAsyncThen(continueRepaintTest); |
| 46 }; | 47 }; |
| 47 } | 48 } |
| 48 | 49 |
| 49 function runRepaintAndPixelTest() | |
| 50 { | |
| 51 window.enablePixelTesting = true; | |
| 52 runRepaintTest(); | |
| 53 } | |
| 54 | |
| 55 function forceStyleRecalc() | 50 function forceStyleRecalc() |
| 56 { | 51 { |
| 57 if (document.body) | 52 if (document.body) |
| 58 document.body.clientTop; | 53 document.body.clientTop; |
| 59 else if (document.documentElement) | 54 else if (document.documentElement) |
| 60 document.documentElement.clientTop; | 55 document.documentElement.clientTop; |
| 61 } | 56 } |
| 62 | 57 |
| 63 function finishRepaintTest() | 58 function finishRepaintTest() |
| 64 { | 59 { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } else { | 182 } else { |
| 188 var newRect = [xBegin, y, xWidth, 1]; | 183 var newRect = [xBegin, y, xWidth, 1]; |
| 189 nextRectsMayContinue.push(newRect); | 184 nextRectsMayContinue.push(newRect); |
| 190 result.push(newRect); | 185 result.push(newRect); |
| 191 } | 186 } |
| 192 } | 187 } |
| 193 rectsMayContinue = nextRectsMayContinue; | 188 rectsMayContinue = nextRectsMayContinue; |
| 194 } | 189 } |
| 195 return result; | 190 return result; |
| 196 } | 191 } |
| OLD | NEW |