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); |
+ }); |
+} |