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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/misc/resources/resource-timing-sizes-xhr-fetch.js

Issue 2159163002: Set Resource Timing transferSize field in Workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_render_process
Patch Set: Rebase Created 4 years, 5 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/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();

Powered by Google App Engine
This is Rietveld 408576698