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

Side by Side Diff: third_party/WebKit/LayoutTests/resources/run-after-layout-and-paint.js

Issue 2093103003: CL for perf tryjob on win (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CL for perf tryjob on mac Created 4 years, 5 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
OLDNEW
1 // Run a callback after layout and paint of all pending document changes. 1 // Run a callback after layout and paint of all pending document changes.
2 // 2 //
3 // It has two modes: 3 // It has two modes:
4 // - traditional mode, for existing tests, and tests needing customized notifyDo ne timing: 4 // - traditional mode, for existing tests, and tests needing customized notifyDo ne timing:
5 // Usage: 5 // Usage:
6 // if (window.testRunner) 6 // if (window.testRunner)
7 // testRunner.waitUntilDone(); 7 // testRunner.waitUntilDone();
8 // runAfterLayoutAndPaint(function() { 8 // runAfterLayoutAndPaint(function() {
9 // ... // some code which modifies style/layout 9 // ... // some code which modifies style/layout
10 // if (window.testRunner) 10 // if (window.testRunner)
11 // testRunner.notifyDone(); 11 // testRunner.notifyDone();
12 // // Or to ensure the next paint is executed before the test finishes: 12 // // Or to ensure the next paint is executed before the test finishes:
13 // // if (window.testRunner) 13 // // if (window.testRunner)
14 // // runAfterAfterLayoutAndPaint(function() { testRunner.notifyDone() } ); 14 // // runAfterAfterLayoutAndPaint(function() { testRunner.notifyDone() } );
15 // // Or notifyDone any time later if needed. 15 // // Or notifyDone any time later if needed.
16 // }); 16 // });
17 // 17 //
18 // - autoNotifyDone mode, for new tests which just need to change style/layout a nd finish: 18 // - autoNotifyDone mode, for new tests which just need to change style/layout a nd finish:
19 // Usage: 19 // Usage:
20 // runAfterLayoutAndPaint(function() { 20 // runAfterLayoutAndPaint(function() {
21 // ... // some code which modifies style/layout 21 // ... // some code which modifies style/layout
22 // }, true); 22 // }, true);
23 23
24 if (window.internals) {
25 // TODO(wangxianzhu): Some spv2 tests crash with under-invalidation-checking
26 // because the extra display items between Subsequence/EndSubsequence for
27 // under-invalidation checking breaks paint chunks. Should fix this when fix ing
28 // crbug.com/596983.
29 if (!internals.runtimeFlags.slimmingPaintV2Enabled)
30 internals.runtimeFlags.slimmingPaintUnderInvalidationCheckingEnabled = t rue;
31 }
32
24 function runAfterLayoutAndPaint(callback, autoNotifyDone) { 33 function runAfterLayoutAndPaint(callback, autoNotifyDone) {
25 if (!window.testRunner) { 34 if (!window.testRunner) {
26 // For manual test. Delay 500ms to allow us to see the visual change 35 // For manual test. Delay 500ms to allow us to see the visual change
27 // caused by the callback. 36 // caused by the callback.
28 setTimeout(callback, 500); 37 setTimeout(callback, 500);
29 return; 38 return;
30 } 39 }
31 40
32 if (autoNotifyDone) 41 if (autoNotifyDone)
33 testRunner.waitUntilDone(); 42 testRunner.waitUntilDone();
34 43
35 testRunner.layoutAndPaintAsyncThen(function() { 44 testRunner.layoutAndPaintAsyncThen(function() {
36 callback(); 45 callback();
37 if (autoNotifyDone) 46 if (autoNotifyDone)
38 testRunner.notifyDone(); 47 testRunner.notifyDone();
39 }); 48 });
40 } 49 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/InlineTextBoxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698