Index: third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-xhr-fetch.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/resource-timing-sizes-xhr-fetch.html b/third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-xhr-fetch.js |
similarity index 90% |
copy from third_party/WebKit/LayoutTests/http/tests/misc/resource-timing-sizes-xhr-fetch.html |
copy to third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-xhr-fetch.js |
index a917ebf9939f88c919cc98cd6dfd60e9fa434066..33b2fa0e9569dc963d96f42f5fac94b910189d04 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/misc/resource-timing-sizes-xhr-fetch.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-xhr-fetch.js |
@@ -1,7 +1,10 @@ |
-<!DOCTYPE html> |
-<script src="/resources/testharness.js"></script> |
-<script src="/resources/testharnessreport.js"></script> |
-<script> |
+// This test code is shared between resource-timing-sizes-xhr-fetch.html |
+// and resource-timing-sizes-xhr-fetch-worker.html |
+ |
+if (typeof document === 'undefined') { |
+ importScripts('/resources/testharness.js'); |
+} |
+ |
const XHR_SYNC_URL = '/resources/dummy.xml?t=syncxhr'; |
const XHR_ASYNC_URL = '/resources/dummy.xml?t=asyncxhr'; |
const FETCH_URL = '/resources/dummy.xml?t=fetch'; |
@@ -61,5 +64,6 @@ function runTest() { |
.catch(t.step_func(() => assert_unreached('Fetch error'))); |
} |
-window.onload = t.step_func(runTest); |
-</script> |
+runTest(); |
+ |
+done(); |