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

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

Issue 2868003002: CSSPaint: Move layout tests in csspaint/ to http/tests/csspaint/ (Closed)
Patch Set: rebase Created 3 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/http/tests/csspaint/valid-image-before-load-expected.html ('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
(Empty)
1 // Run a callback after layout and paint of all pending document changes.
2 //
3 // It has two modes:
4 // - traditional mode, for existing tests, and tests needing customized notifyDo ne timing:
5 // Usage:
6 // if (window.testRunner)
7 // testRunner.waitUntilDone();
8 // runAfterLayoutAndPaint(function() {
9 // ... // some code which modifies style/layout
10 // if (window.testRunner)
11 // testRunner.notifyDone();
12 // // Or to ensure the next paint is executed before the test finishes:
13 // // if (window.testRunner)
14 // // runAfterAfterLayoutAndPaint(function() { testRunner.notifyDone() } );
15 // // Or notifyDone any time later if needed.
16 // });
17 //
18 // - autoNotifyDone mode, for new tests which just need to change style/layout a nd finish:
19 // Usage:
20 // runAfterLayoutAndPaint(function() {
21 // ... // some code which modifies style/layout
22 // }, true);
23
24 if (window.internals)
25 internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = true;
26
27 function runAfterLayoutAndPaint(callback, autoNotifyDone) {
28 if (!window.testRunner) {
29 // For manual test. Delay 500ms to allow us to see the visual change
30 // caused by the callback.
31 setTimeout(callback, 500);
32 return;
33 }
34
35 if (autoNotifyDone)
36 testRunner.waitUntilDone();
37
38 testRunner.layoutAndPaintAsyncThen(function() {
39 callback();
40 if (autoNotifyDone)
41 testRunner.notifyDone();
42 });
43 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/csspaint/valid-image-before-load-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698