Index: third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-cors-preflight.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/resource-timing-sizes-cors-preflight.html b/third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-cors-preflight.js |
similarity index 85% |
copy from third_party/WebKit/LayoutTests/http/tests/misc/resource-timing-sizes-cors-preflight.html |
copy to third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-cors-preflight.js |
index 6525e2f87350adb68705343cdf936957b6daf84c..ad658adae76f5736607319ed2933e568ed35a9ef 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/misc/resource-timing-sizes-cors-preflight.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-cors-preflight.js |
@@ -1,9 +1,12 @@ |
-<!DOCTYPE html> |
-<script src="/resources/testharness.js"></script> |
-<script src="/resources/testharnessreport.js"></script> |
-<script src="/resources/get-host-info.js?pipe=sub"></script> |
-<script src="/misc/resources/run-async-tasks-promise.js"></script> |
-<script> |
+// This test code is shared between resource-timing-sizes-cors-preflight.html |
+// and resource-timing-sizes-cors-preflight-worker.html |
+ |
+if (typeof document === 'undefined') { |
+ importScripts('/resources/testharness.js', |
+ '/resources/get-host-info.js?pipe=sub', |
+ '/misc/resources/run-async-tasks-promise.js'); |
+} |
+ |
// Because apache decrements the Keep-Alive max value on each request, the |
// transferSize will vary slightly between requests for the same resource. |
const fuzzFactor = 3; // bytes |
@@ -60,4 +63,5 @@ promise_test(() => { |
.then(runAsyncTasks) |
.then(checkResourceSizes); |
}, 'PerformanceResourceTiming sizes Fetch with preflight test'); |
-</script> |
+ |
+done(); |