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

Unified Diff: third_party/WebKit/LayoutTests/css1/resources/base.js

Issue 2588283002: Most css1/ tests should wait for basebg.gif to be loaded (Closed)
Patch Set: fix Created 4 years 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/css1/resources/base.js
diff --git a/third_party/WebKit/LayoutTests/css1/resources/base.js b/third_party/WebKit/LayoutTests/css1/resources/base.js
new file mode 100644
index 0000000000000000000000000000000000000000..af2d8bc7267cdf4ce645244e6bf59f04e2095f6d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css1/resources/base.js
@@ -0,0 +1,17 @@
+if (window.testRunner) {
+ // This is a workaroud for an issue that the load event may be dispatched
+ // before loading ../resources/basebg.gif which is linked from
+ // ../resources/base.css.
+ testRunner.waitUntilDone();
+ window.addEventListener('load', () => {
+ const id = setInterval(() => {
+ // Force layout.
+ document.body.offsetTop;
+ if (internals.isLoading('../resources/basebg.gif'))
+ return;
+
+ clearInterval(id);
+ testRunner.notifyDone();
+ }, 50);
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698