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

Unified Diff: third_party/WebKit/LayoutTests/fast/table/resources/wait-for-onload.js

Issue 2822093003: Some fast/table tests should wait for images specified via CSS url() (Closed)
Patch Set: fix Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/table/resources/wait-for-onload.js
diff --git a/third_party/WebKit/LayoutTests/fast/table/resources/wait-for-onload.js b/third_party/WebKit/LayoutTests/fast/table/resources/wait-for-onload.js
new file mode 100644
index 0000000000000000000000000000000000000000..4afdabc11c106987c99dcf02814bf47929a8d0e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/table/resources/wait-for-onload.js
@@ -0,0 +1,15 @@
+if (window.testRunner) {
+ // This is a workaroud for an issue that the test runner sends notifyDone
+ // before resources specified in CSS url finish loading. Currently all
+ // such resources are specified in inline CSSs so we can rely on the
+ // Document load event (Note that we cannot rely on that with linked
+ // CSSs).
+ testRunner.waitUntilDone();
+ window.addEventListener('load', () => {
+ // Force layout.
+ document.body.offsetTop;
+
+ testRunner.notifyDone();
+ });
+}
+

Powered by Google App Engine
This is Rietveld 408576698