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

Side by Side Diff: third_party/WebKit/LayoutTests/paint/invalidation/spv2/resources/paint-invalidation-test.js

Issue 1983813002: Remove workaround for multiple svg onload events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/repaint/resources/text-based-repaint.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Asynchronous tests should manually call finishPaintInvalidationTest at the ap propriate time. 1 // Asynchronous tests should manually call finishPaintInvalidationTest at the ap propriate time.
2 window.testIsAsync = false; 2 window.testIsAsync = false;
3 3
4 // All paint invalidation tests are asynchronous from test-runner's point of vie w. 4 // All paint invalidation tests are asynchronous from test-runner's point of vie w.
5 if (window.testRunner) { 5 if (window.testRunner) {
6 testRunner.waitUntilDone(); 6 testRunner.waitUntilDone();
7 if (document.location.hash == '#as-text') 7 if (document.location.hash == '#as-text')
8 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
9 } 9 }
10 10
11 function runPaintInvalidationTest() 11 function runPaintInvalidationTest()
12 { 12 {
13 if (!window.testRunner || !window.internals) { 13 if (!window.testRunner || !window.internals) {
14 setTimeout(paintInvalidationTest, 500); 14 setTimeout(paintInvalidationTest, 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.hasRunPaintInvalidationTest)
21 return;
22 window.hasRunPaintInvalidationTest = true;
23
24 testRunner.layoutAndPaintAsyncThen(function() 18 testRunner.layoutAndPaintAsyncThen(function()
25 { 19 {
26 window.internals.startTrackingPaintInvalidationObjects(); 20 window.internals.startTrackingPaintInvalidationObjects();
27 paintInvalidationTest(); 21 paintInvalidationTest();
28 if (!window.testIsAsync) 22 if (!window.testIsAsync)
29 finishPaintInvalidationTest(); 23 finishPaintInvalidationTest();
30 }); 24 });
31 } 25 }
32 26
33 function removeAllChildren(element) 27 function removeAllChildren(element)
34 { 28 {
35 while (element.firstChild) 29 while (element.firstChild)
36 element.removeChild(element.firstChild); 30 element.removeChild(element.firstChild);
37 } 31 }
38 32
39 function finishPaintInvalidationTest() 33 function finishPaintInvalidationTest()
40 { 34 {
41 if (!window.testRunner || !window.internals) 35 if (!window.testRunner || !window.internals)
42 return; 36 return;
43 37
44 testRunner.layoutAndPaintAsyncThen(function() 38 testRunner.layoutAndPaintAsyncThen(function()
45 { 39 {
46 testRunner.setCustomTextOutput(JSON.stringify(internals.trackedPaintInva lidationObjects()).replace(/","/g, '",\n "')); 40 testRunner.setCustomTextOutput(JSON.stringify(internals.trackedPaintInva lidationObjects()).replace(/","/g, '",\n "'));
47 testRunner.notifyDone(); 41 testRunner.notifyDone();
48 }); 42 });
49 } 43 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/repaint/resources/text-based-repaint.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698