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

Side by Side Diff: LayoutTests/fast/repaint/resources/text-based-repaint.js

Issue 184213004: Fix fast/repaint/block-layout-inline-children-replaced.html (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Re-added the post-test hook as it is needed by svg/dynamic-updates/ tests. Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Asynchronous tests should manually call finishRepaintTest at the appropriate time.
2 window.testIsAsync = false;
3
1 function runRepaintTest() 4 function runRepaintTest()
2 { 5 {
3 if (window.testRunner && window.internals) { 6 if (!window.testRunner || !window.internals) {
4 if (window.enablePixelTesting) 7 setTimeout(repaintTest, 100);
5 window.testRunner.dumpAsTextWithPixelResults(); 8 return;
6 else 9 }
7 window.testRunner.dumpAsText();
8 10
9 if (document.body) 11 if (window.enablePixelTesting)
10 document.body.offsetTop; 12 testRunner.dumpAsTextWithPixelResults();
11 else if (document.documentElement) 13 else
12 document.documentElement.offsetTop; 14 testRunner.dumpAsText();
13 15
14 window.internals.startTrackingRepaints(document); 16 if (window.testIsAsync)
17 testRunner.waitUntilDone();
15 18
16 repaintTest(); 19 if (document.body)
20 document.body.offsetTop;
21 else if (document.documentElement)
22 document.documentElement.offsetTop;
17 23
18 // force a style recalc. 24 window.internals.startTrackingRepaints(document);
19 var dummy = document.body.offsetTop;
20 25
21 var repaintRects = window.internals.repaintRectsAsText(document); 26 repaintTest();
22 27
23 window.internals.stopTrackingRepaints(document); 28 if (!window.testIsAsync)
29 finishRepaintTest();
30 }
24 31
25 var pre = document.createElement('pre'); 32 function finishRepaintTest()
26 document.body.appendChild(pre); 33 {
27 pre.textContent += repaintRects; 34 // Force a style recalc.
35 var dummy = document.body.offsetTop;
28 36
29 if (window.afterTest) 37 var repaintRects = window.internals.repaintRectsAsText(document);
30 window.afterTest(); 38
31 } else { 39 internals.stopTrackingRepaints(document);
32 setTimeout(repaintTest, 100); 40
33 } 41 var pre = document.createElement('pre');
42 document.body.appendChild(pre);
43 pre.textContent += repaintRects;
44
45 if (window.afterTest)
46 window.afterTest();
47
48 if (window.testIsAsync)
49 testRunner.notifyDone();
34 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698