Bug 1456505 [wpt PR 10605] - Fetch: reduce boilerplate in api/basic/, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Tue, 01 May 2018 14:54:58 +0000
changeset 472668 e6e2cb4c1553e48518126438d8c43ae24d10bc57
parent 472667 31b6943c7bec30239685fc0955099a5d5795eea7
child 472669 24e904d3e8221c92932dfb4de9f70de791287815
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1456505, 10605
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1456505 [wpt PR 10605] - Fetch: reduce boilerplate in api/basic/, a=testonly Automatic update from web-platform-testsFetch: reduce boilerplate in api/basic/ -- wpt-commits: 8e66eb476c019bc90ca345faf2c7178dab0c0837 wpt-pr: 10605
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/fetch/api/basic/integrity-sharedworker.html
testing/web-platform/tests/fetch/api/basic/integrity-worker.html
testing/web-platform/tests/fetch/api/basic/integrity.html
testing/web-platform/tests/fetch/api/basic/integrity.js
testing/web-platform/tests/fetch/api/basic/integrity.sub.any.js
testing/web-platform/tests/fetch/api/basic/mode-no-cors-worker.html
testing/web-platform/tests/fetch/api/basic/mode-no-cors.html
testing/web-platform/tests/fetch/api/basic/mode-no-cors.js
testing/web-platform/tests/fetch/api/basic/mode-no-cors.sub.any.js
testing/web-platform/tests/fetch/api/basic/response-url-worker.html
testing/web-platform/tests/fetch/api/basic/response-url.html
testing/web-platform/tests/fetch/api/basic/response-url.js
testing/web-platform/tests/fetch/api/basic/response-url.sub.any.js
testing/web-platform/tests/fetch/api/basic/scheme-blob-worker.html
testing/web-platform/tests/fetch/api/basic/scheme-blob.html
testing/web-platform/tests/fetch/api/basic/scheme-blob.js
testing/web-platform/tests/fetch/api/basic/scheme-blob.sub.any.js
testing/web-platform/tests/fetch/api/basic/scheme-others-worker.html
testing/web-platform/tests/fetch/api/basic/scheme-others.html
testing/web-platform/tests/fetch/api/basic/scheme-others.js
testing/web-platform/tests/fetch/api/basic/scheme-others.sub.any.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -273789,41 +273789,16 @@
      {}
     ]
    ],
    "fetch/README.md": [
     [
      {}
     ]
    ],
-   "fetch/api/basic/integrity.js": [
-    [
-     {}
-    ]
-   ],
-   "fetch/api/basic/mode-no-cors.js": [
-    [
-     {}
-    ]
-   ],
-   "fetch/api/basic/response-url.js": [
-    [
-     {}
-    ]
-   ],
-   "fetch/api/basic/scheme-blob.js": [
-    [
-     {}
-    ]
-   ],
-   "fetch/api/basic/scheme-others.js": [
-    [
-     {}
-    ]
-   ],
    "fetch/api/cors/cors-expose-star.js": [
     [
      {}
     ]
    ],
    "fetch/api/cors/cors-filtering.js": [
     [
      {}
@@ -328691,55 +328666,49 @@
     ]
    ],
    "fetch/api/basic/error-after-response.html": [
     [
      "/fetch/api/basic/error-after-response.html",
      {}
     ]
    ],
-   "fetch/api/basic/integrity-sharedworker.html": [
-    [
-     "/fetch/api/basic/integrity-sharedworker.html",
-     {}
-    ]
-   ],
-   "fetch/api/basic/integrity-worker.html": [
-    [
-     "/fetch/api/basic/integrity-worker.html",
-     {}
-    ]
-   ],
-   "fetch/api/basic/integrity.html": [
-    [
-     "/fetch/api/basic/integrity.html",
+   "fetch/api/basic/integrity.sub.any.js": [
+    [
+     "/fetch/api/basic/integrity.sub.any.html",
+     {}
+    ],
+    [
+     "/fetch/api/basic/integrity.sub.any.sharedworker.html",
+     {}
+    ],
+    [
+     "/fetch/api/basic/integrity.sub.any.worker.html",
      {}
     ]
    ],
    "fetch/api/basic/keepalive.html": [
     [
      "/fetch/api/basic/keepalive.html",
      {}
     ]
    ],
    "fetch/api/basic/mediasource.window.js": [
     [
      "/fetch/api/basic/mediasource.window.html",
      {}
     ]
    ],
-   "fetch/api/basic/mode-no-cors-worker.html": [
-    [
-     "/fetch/api/basic/mode-no-cors-worker.html",
-     {}
-    ]
-   ],
-   "fetch/api/basic/mode-no-cors.html": [
-    [
-     "/fetch/api/basic/mode-no-cors.html",
+   "fetch/api/basic/mode-no-cors.sub.any.js": [
+    [
+     "/fetch/api/basic/mode-no-cors.sub.any.html",
+     {}
+    ],
+    [
+     "/fetch/api/basic/mode-no-cors.sub.any.worker.html",
      {}
     ]
    ],
    "fetch/api/basic/mode-same-origin.any.js": [
     [
      "/fetch/api/basic/mode-same-origin.any.html",
      {}
     ],
@@ -328819,69 +328788,63 @@
      "/fetch/api/basic/request-upload.any.html",
      {}
     ],
     [
      "/fetch/api/basic/request-upload.any.worker.html",
      {}
     ]
    ],
-   "fetch/api/basic/response-url-worker.html": [
-    [
-     "/fetch/api/basic/response-url-worker.html",
-     {}
-    ]
-   ],
-   "fetch/api/basic/response-url.html": [
-    [
-     "/fetch/api/basic/response-url.html",
+   "fetch/api/basic/response-url.sub.any.js": [
+    [
+     "/fetch/api/basic/response-url.sub.any.html",
+     {}
+    ],
+    [
+     "/fetch/api/basic/response-url.sub.any.worker.html",
      {}
     ]
    ],
    "fetch/api/basic/scheme-about.any.js": [
     [
      "/fetch/api/basic/scheme-about.any.html",
      {}
     ],
     [
      "/fetch/api/basic/scheme-about.any.worker.html",
      {}
     ]
    ],
-   "fetch/api/basic/scheme-blob-worker.html": [
-    [
-     "/fetch/api/basic/scheme-blob-worker.html",
-     {}
-    ]
-   ],
-   "fetch/api/basic/scheme-blob.html": [
-    [
-     "/fetch/api/basic/scheme-blob.html",
+   "fetch/api/basic/scheme-blob.sub.any.js": [
+    [
+     "/fetch/api/basic/scheme-blob.sub.any.html",
+     {}
+    ],
+    [
+     "/fetch/api/basic/scheme-blob.sub.any.worker.html",
      {}
     ]
    ],
    "fetch/api/basic/scheme-data.any.js": [
     [
      "/fetch/api/basic/scheme-data.any.html",
      {}
     ],
     [
      "/fetch/api/basic/scheme-data.any.worker.html",
      {}
     ]
    ],
-   "fetch/api/basic/scheme-others-worker.html": [
-    [
-     "/fetch/api/basic/scheme-others-worker.html",
-     {}
-    ]
-   ],
-   "fetch/api/basic/scheme-others.html": [
-    [
-     "/fetch/api/basic/scheme-others.html",
+   "fetch/api/basic/scheme-others.sub.any.js": [
+    [
+     "/fetch/api/basic/scheme-others.sub.any.html",
+     {}
+    ],
+    [
+     "/fetch/api/basic/scheme-others.sub.any.worker.html",
      {}
     ]
    ],
    "fetch/api/basic/stream-response.any.js": [
     [
      "/fetch/api/basic/stream-response.any.html",
      {}
     ],
@@ -557482,51 +557445,31 @@
   "fetch/api/basic/conditional-get.html": [
    "77822a239b405b0b5c0259a335bac6cbe26b7fed",
    "testharness"
   ],
   "fetch/api/basic/error-after-response.html": [
    "54181cd222c7a5428f9468f4777c273ecc553f4f",
    "testharness"
   ],
-  "fetch/api/basic/integrity-sharedworker.html": [
-   "00d7eae5a324653caae19ab83bef76dd3503fb3b",
-   "testharness"
-  ],
-  "fetch/api/basic/integrity-worker.html": [
-   "1a0a6abd1c6bf8c4665a242d64f50bbbff4982f8",
-   "testharness"
-  ],
-  "fetch/api/basic/integrity.html": [
-   "aa6d9159321e410d1e96c045f8f4d8700494beeb",
-   "testharness"
-  ],
-  "fetch/api/basic/integrity.js": [
-   "59e8c5ebf0dfd2ab2432f28dcee5db82e9505cff",
-   "support"
+  "fetch/api/basic/integrity.sub.any.js": [
+   "7f25bf12a25919d07f2fd04fabaf8cd90f4cf77a",
+   "testharness"
   ],
   "fetch/api/basic/keepalive.html": [
    "1ecdcb478b65b258e79242ae17af79ba903db412",
    "testharness"
   ],
   "fetch/api/basic/mediasource.window.js": [
    "5e2e35f820982002b967d7444507a2bfc0d3aa34",
    "testharness"
   ],
-  "fetch/api/basic/mode-no-cors-worker.html": [
-   "39992b8abf3ab30182dfbaa5816cc154a22ae0ad",
-   "testharness"
-  ],
-  "fetch/api/basic/mode-no-cors.html": [
-   "ff174cb1a76a63473028b72b3319602685689cb5",
-   "testharness"
-  ],
-  "fetch/api/basic/mode-no-cors.js": [
-   "311ecadfe0c44430846b2f11facf53c1fafc6df0",
-   "support"
+  "fetch/api/basic/mode-no-cors.sub.any.js": [
+   "5ccf57aa2feb7d11e4372ba71f81d6726875ae03",
+   "testharness"
   ],
   "fetch/api/basic/mode-same-origin.any.js": [
    "1027de012d62a36a0df53bfadbfb8341a22558c0",
    "testharness"
   ],
   "fetch/api/basic/referrer.any.js": [
    "08968517620d9d0fa894972140bbbb39a340df26",
    "testharness"
@@ -557554,59 +557497,35 @@
   "fetch/api/basic/request-referrer.any.js": [
    "309c213b04bc716a20ca6a74f1533d4773d89161",
    "testharness"
   ],
   "fetch/api/basic/request-upload.any.js": [
    "8c85a2549ca2108b07f8065699a8dd182acc6268",
    "testharness"
   ],
-  "fetch/api/basic/response-url-worker.html": [
-   "3d615668cb0122600af10d80cac4a7ebfe051528",
-   "testharness"
-  ],
-  "fetch/api/basic/response-url.html": [
-   "9e7c61ac685654e355174c960ba2084d17ff7f2e",
-   "testharness"
-  ],
-  "fetch/api/basic/response-url.js": [
-   "444ef1e53b422f74a4bb322099d8b1147ed8f52b",
-   "support"
+  "fetch/api/basic/response-url.sub.any.js": [
+   "f43c11ef52661046824b328112f6ab8826bed027",
+   "testharness"
   ],
   "fetch/api/basic/scheme-about.any.js": [
    "68b11deaa95a691a8e0c76bdc9b7a07b5dea9868",
    "testharness"
   ],
-  "fetch/api/basic/scheme-blob-worker.html": [
-   "adfea540164a4113484ea29007ac3738bb7456c4",
-   "testharness"
-  ],
-  "fetch/api/basic/scheme-blob.html": [
-   "5835c0c3b108f05b61ef0db945f272264b377d6c",
-   "testharness"
-  ],
-  "fetch/api/basic/scheme-blob.js": [
-   "ab29ee7bde800b3ffaade990d86816ea9b6cb2c7",
-   "support"
+  "fetch/api/basic/scheme-blob.sub.any.js": [
+   "ec722257d9e93842751547b5a2a8cfff9da6d9de",
+   "testharness"
   ],
   "fetch/api/basic/scheme-data.any.js": [
    "d312396ed3c5a90004d46c3d630525cb3e8228e1",
    "testharness"
   ],
-  "fetch/api/basic/scheme-others-worker.html": [
-   "4ea145afbbe3b349c227c19ac5612db94b10c61c",
-   "testharness"
-  ],
-  "fetch/api/basic/scheme-others.html": [
-   "e7594d1119e1c937663b4bb0385b69c442f1c78f",
-   "testharness"
-  ],
-  "fetch/api/basic/scheme-others.js": [
-   "e9f99ee8112a0e0983322aece2034461125a46b5",
-   "support"
+  "fetch/api/basic/scheme-others.sub.any.js": [
+   "9b82765bb46386db2408260c14a511afb0ba662e",
+   "testharness"
   ],
   "fetch/api/basic/stream-response.any.js": [
    "b989131e8cf68e37c6d27397d801bfcc9c97b7ed",
    "testharness"
   ],
   "fetch/api/basic/text-utf8.html": [
    "e767fdc6323165aaf50775185704cb66c4250ebd",
    "testharness"
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/integrity-sharedworker.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch in sharedworker: integrity handling</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script>
-      fetch_tests_from_worker(new SharedWorker("integrity.js?pipe=sub"));
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/integrity-worker.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch in worker: integrity handling</title>
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script>
-      fetch_tests_from_worker(new Worker("integrity.js?pipe=sub"));
-    </script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/integrity.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch: integrity handling</title>
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script src="../resources/utils.js"></script>
-    <script src="integrity.js?pipe=sub"></script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/integrity.js
+++ /dev/null
@@ -1,79 +0,0 @@
-if (this.document === undefined) {
-  importScripts("/resources/testharness.js");
-  importScripts("../resources/utils.js");
-}
-
-function integrity(desc, url, integrity, initRequestMode, shouldPass) {
-  var fetchRequestInit = {'integrity': integrity}
-  if (!!initRequestMode && initRequestMode !== "") {
-    fetchRequestInit.mode = initRequestMode;
-  }
-
-  if (shouldPass) {
-    promise_test(function(test) {
-      return fetch(url, fetchRequestInit).then(function(resp) {
-        if (initRequestMode !== "no-cors") {
-          assert_equals(resp.status, 200, "Response's status is 200");
-        } else {
-          assert_equals(resp.status, 0, "Opaque response's status is 0");
-          assert_equals(resp.type, "opaque");
-        }
-      });
-    }, desc);
-  } else {
-    promise_test(function(test) {
-      return promise_rejects(test, new TypeError(), fetch(url, fetchRequestInit));
-    }, desc);
-  }
-}
-
-const topSha256 = "sha256-KHIDZcXnR2oBHk9DrAA+5fFiR6JjudYjqoXtMR1zvzk=";
-const topSha384 = "sha384-MgZYnnAzPM/MjhqfOIMfQK5qcFvGZsGLzx4Phd7/A8fHTqqLqXqKo8cNzY3xEPTL";
-const topSha512 = "sha512-D6yns0qxG0E7+TwkevZ4Jt5t7Iy3ugmAajG/dlf6Pado1JqTyneKXICDiqFIkLMRExgtvg8PlxbKTkYfRejSOg==";
-const invalidSha256 = "sha256-dKUcPOn/AlUjWIwcHeHNqYXPlvyGiq+2dWOdFcE+24I=";
-const invalidSha512 = "sha512-oUceBRNxPxnY60g/VtPCj2syT4wo4EZh2CgYdWy9veW8+OsReTXoh7dizMGZafvx9+QhMS39L/gIkxnPIn41Zg==";
-
-const path = dirname(location.pathname) + RESOURCES_DIR + "top.txt";
-const url = path;
-const corsUrl =
-  `http://{{host}}:{{ports[http][1]}}${path}?pipe=header(Access-Control-Allow-Origin,*)`;
-const corsUrl2 = `https://{{host}}:{{ports[https][0]}}${path}`
-
-integrity("Empty string integrity", url, "", /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("SHA-256 integrity", url, topSha256, /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("SHA-384 integrity", url, topSha384, /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("SHA-512 integrity", url, topSha512, /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("Invalid integrity", url, invalidSha256,
-          /* initRequestMode */ undefined, /* shouldPass */  false);
-integrity("Multiple integrities: valid stronger than invalid", url,
-          invalidSha256 + " " + topSha384, /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("Multiple integrities: invalid stronger than valid",
-          url, invalidSha512 + " " + topSha384, /* initRequestMode */ undefined,
-          /* shouldPass */ false);
-integrity("Multiple integrities: invalid as strong as valid", url,
-          invalidSha512 + " " + topSha512, /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("Multiple integrities: both are valid", url,
-          topSha384 + " " + topSha512, /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("Multiple integrities: both are invalid", url,
-          invalidSha256 + " " + invalidSha512, /* initRequestMode */ undefined,
-          /* shouldPass */ false);
-integrity("CORS empty integrity", corsUrl, "", /* initRequestMode */ undefined,
-          /* shouldPass */ true);
-integrity("CORS SHA-512 integrity", corsUrl, topSha512,
-          /* initRequestMode */ undefined, /* shouldPass */ true);
-integrity("CORS invalid integrity", corsUrl, invalidSha512,
-          /* initRequestMode */ undefined, /* shouldPass */ false);
-
-integrity("Empty string integrity for opaque response", corsUrl2, "",
-          /* initRequestMode */ "no-cors", /* shouldPass */ true);
-integrity("SHA-* integrity for opaque response", corsUrl2, topSha512,
-          /* initRequestMode */ "no-cors", /* shouldPass */ false);
-
-done();
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/basic/integrity.sub.any.js
@@ -0,0 +1,77 @@
+// META: global=sharedworker
+// META: script=../resources/utils.js
+
+function integrity(desc, url, integrity, initRequestMode, shouldPass) {
+  var fetchRequestInit = {'integrity': integrity}
+  if (!!initRequestMode && initRequestMode !== "") {
+    fetchRequestInit.mode = initRequestMode;
+  }
+
+  if (shouldPass) {
+    promise_test(function(test) {
+      return fetch(url, fetchRequestInit).then(function(resp) {
+        if (initRequestMode !== "no-cors") {
+          assert_equals(resp.status, 200, "Response's status is 200");
+        } else {
+          assert_equals(resp.status, 0, "Opaque response's status is 0");
+          assert_equals(resp.type, "opaque");
+        }
+      });
+    }, desc);
+  } else {
+    promise_test(function(test) {
+      return promise_rejects(test, new TypeError(), fetch(url, fetchRequestInit));
+    }, desc);
+  }
+}
+
+const topSha256 = "sha256-KHIDZcXnR2oBHk9DrAA+5fFiR6JjudYjqoXtMR1zvzk=";
+const topSha384 = "sha384-MgZYnnAzPM/MjhqfOIMfQK5qcFvGZsGLzx4Phd7/A8fHTqqLqXqKo8cNzY3xEPTL";
+const topSha512 = "sha512-D6yns0qxG0E7+TwkevZ4Jt5t7Iy3ugmAajG/dlf6Pado1JqTyneKXICDiqFIkLMRExgtvg8PlxbKTkYfRejSOg==";
+const invalidSha256 = "sha256-dKUcPOn/AlUjWIwcHeHNqYXPlvyGiq+2dWOdFcE+24I=";
+const invalidSha512 = "sha512-oUceBRNxPxnY60g/VtPCj2syT4wo4EZh2CgYdWy9veW8+OsReTXoh7dizMGZafvx9+QhMS39L/gIkxnPIn41Zg==";
+
+const path = dirname(location.pathname) + RESOURCES_DIR + "top.txt";
+const url = path;
+const corsUrl =
+  `http://{{host}}:{{ports[http][1]}}${path}?pipe=header(Access-Control-Allow-Origin,*)`;
+const corsUrl2 = `https://{{host}}:{{ports[https][0]}}${path}`
+
+integrity("Empty string integrity", url, "", /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("SHA-256 integrity", url, topSha256, /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("SHA-384 integrity", url, topSha384, /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("SHA-512 integrity", url, topSha512, /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("Invalid integrity", url, invalidSha256,
+          /* initRequestMode */ undefined, /* shouldPass */  false);
+integrity("Multiple integrities: valid stronger than invalid", url,
+          invalidSha256 + " " + topSha384, /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("Multiple integrities: invalid stronger than valid",
+          url, invalidSha512 + " " + topSha384, /* initRequestMode */ undefined,
+          /* shouldPass */ false);
+integrity("Multiple integrities: invalid as strong as valid", url,
+          invalidSha512 + " " + topSha512, /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("Multiple integrities: both are valid", url,
+          topSha384 + " " + topSha512, /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("Multiple integrities: both are invalid", url,
+          invalidSha256 + " " + invalidSha512, /* initRequestMode */ undefined,
+          /* shouldPass */ false);
+integrity("CORS empty integrity", corsUrl, "", /* initRequestMode */ undefined,
+          /* shouldPass */ true);
+integrity("CORS SHA-512 integrity", corsUrl, topSha512,
+          /* initRequestMode */ undefined, /* shouldPass */ true);
+integrity("CORS invalid integrity", corsUrl, invalidSha512,
+          /* initRequestMode */ undefined, /* shouldPass */ false);
+
+integrity("Empty string integrity for opaque response", corsUrl2, "",
+          /* initRequestMode */ "no-cors", /* shouldPass */ true);
+integrity("SHA-* integrity for opaque response", corsUrl2, topSha512,
+          /* initRequestMode */ "no-cors", /* shouldPass */ false);
+
+done();
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/mode-no-cors-worker.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch in worker: no-cors mode and opaque filtering</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque">
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script>
-      fetch_tests_from_worker(new Worker("mode-no-cors.js?pipe=sub"));
-    </script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/mode-no-cors.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch: no-cors mode and opaque filtering</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque">
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script src="../resources/utils.js"></script>
-    <script src="mode-no-cors.js?pipe=sub"></script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/mode-no-cors.js
+++ /dev/null
@@ -1,31 +0,0 @@
-if (this.document === undefined) {
-  importScripts("/resources/testharness.js");
-  importScripts("../resources/utils.js");
-}
-
-function fetchNoCors(url, isOpaqueFiltered) {
-  var urlQuery = "?pipe=header(x-is-filtered,value)"
-  promise_test(function(test) {
-    if (isOpaqueFiltered)
-      return fetch(url + urlQuery, {"mode": "no-cors"}).then(function(resp) {
-        assert_equals(resp.status, 0, "Opaque filter: status is 0");
-        assert_equals(resp.statusText, "", "Opaque filter: statusText is \"\"");
-        assert_equals(resp.type , "opaque", "Opaque filter: response's type is opaque");
-        assert_equals(resp.headers.get("x-is-filtered"), null, "Header x-is-filtered is filtered");
-      });
-    else
-      return fetch(url + urlQuery, {"mode": "no-cors"}).then(function(resp) {
-        assert_equals(resp.status, 200, "HTTP status is 200");
-        assert_equals(resp.type , "basic", "Response's type is basic");
-        assert_equals(resp.headers.get("x-is-filtered"), "value", "Header x-is-filtered is not filtered");
-      });
-  }, "Fetch "+ url + " with no-cors mode");
-}
-
-fetchNoCors(RESOURCES_DIR + "top.txt", false);
-fetchNoCors("http://{{host}}:{{ports[http][0]}}/fetch/api/resources/top.txt", false);
-fetchNoCors("https://{{host}}:{{ports[https][0]}}/fetch/api/resources/top.txt", true);
-fetchNoCors("http://{{host}}:{{ports[http][1]}}/fetch/api/resources/top.txt", true);
-
-done();
-
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/basic/mode-no-cors.sub.any.js
@@ -0,0 +1,28 @@
+// META: script=../resources/utils.js
+
+function fetchNoCors(url, isOpaqueFiltered) {
+  var urlQuery = "?pipe=header(x-is-filtered,value)"
+  promise_test(function(test) {
+    if (isOpaqueFiltered)
+      return fetch(url + urlQuery, {"mode": "no-cors"}).then(function(resp) {
+        assert_equals(resp.status, 0, "Opaque filter: status is 0");
+        assert_equals(resp.statusText, "", "Opaque filter: statusText is \"\"");
+        assert_equals(resp.type , "opaque", "Opaque filter: response's type is opaque");
+        assert_equals(resp.headers.get("x-is-filtered"), null, "Header x-is-filtered is filtered");
+      });
+    else
+      return fetch(url + urlQuery, {"mode": "no-cors"}).then(function(resp) {
+        assert_equals(resp.status, 200, "HTTP status is 200");
+        assert_equals(resp.type , "basic", "Response's type is basic");
+        assert_equals(resp.headers.get("x-is-filtered"), "value", "Header x-is-filtered is not filtered");
+      });
+  }, "Fetch "+ url + " with no-cors mode");
+}
+
+fetchNoCors(RESOURCES_DIR + "top.txt", false);
+fetchNoCors("http://{{host}}:{{ports[http][0]}}/fetch/api/resources/top.txt", false);
+fetchNoCors("https://{{host}}:{{ports[https][0]}}/fetch/api/resources/top.txt", true);
+fetchNoCors("http://{{host}}:{{ports[http][1]}}/fetch/api/resources/top.txt", true);
+
+done();
+
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/response-url-worker.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch in worker: response url getter</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#response-class">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script>
-    fetch_tests_from_worker(new Worker("response-url.js?pipe=sub"));
-    </script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/response-url.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch: response url getter</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#response-class">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script src="response-url.js?pipe=sub"></script>
-  </body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/response-url.js
+++ /dev/null
@@ -1,21 +0,0 @@
-if (this.document === undefined) {
-  importScripts("/resources/testharness.js");
-}
-
-function checkResponseURL(fetchedURL, expectedURL)
-{
-    promise_test(function() {
-        return fetch(fetchedURL).then(function(response) {
-            assert_equals(response.url, expectedURL);
-        });
-    }, "Testing response url getter with " +fetchedURL);
-}
-
-var baseURL = "http://{{host}}:{{ports[http][0]}}";
-checkResponseURL(baseURL + "/ada", baseURL + "/ada");
-checkResponseURL(baseURL + "/#", baseURL + "/");
-checkResponseURL(baseURL + "/#ada", baseURL + "/");
-checkResponseURL(baseURL + "#ada", baseURL + "/");
-
-done();
-
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/basic/response-url.sub.any.js
@@ -0,0 +1,16 @@
+function checkResponseURL(fetchedURL, expectedURL)
+{
+    promise_test(function() {
+        return fetch(fetchedURL).then(function(response) {
+            assert_equals(response.url, expectedURL);
+        });
+    }, "Testing response url getter with " +fetchedURL);
+}
+
+var baseURL = "http://{{host}}:{{ports[http][0]}}";
+checkResponseURL(baseURL + "/ada", baseURL + "/ada");
+checkResponseURL(baseURL + "/#", baseURL + "/");
+checkResponseURL(baseURL + "/#ada", baseURL + "/");
+checkResponseURL(baseURL + "#ada", baseURL + "/");
+
+done();
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/scheme-blob-worker.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch in worker: blob scheme</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script>
-      fetch_tests_from_worker(new Worker("scheme-blob.js?pipe=sub"));
-    </script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/scheme-blob.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch: blob scheme</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script src="../resources/utils.js"></script>
-    <script src="scheme-blob.js?pipe=sub"></script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/scheme-blob.js
+++ /dev/null
@@ -1,48 +0,0 @@
-if (this.document === undefined) {
-  importScripts("/resources/testharness.js");
-  importScripts("../resources/utils.js");
-}
-
-function checkFetchResponse(url, data, mime, size, desc) {
-  promise_test(function(test) {
-    size = size.toString();
-    return fetch(url).then(function(resp) {
-      assert_equals(resp.status, 200, "HTTP status is 200");
-      assert_equals(resp.type, "basic", "response type is basic");
-      assert_equals(resp.headers.get("Content-Type"), mime, "Content-Type is " + resp.headers.get("Content-Type"));
-      assert_equals(resp.headers.get("Content-Length"), size, "Content-Length is " + resp.headers.get("Content-Length"));
-      return resp.text();
-    }).then(function(bodyAsText) {
-      assert_equals(bodyAsText, data, "Response's body is " + data);
-    });
-  }, desc);
-}
-
-var blob = new Blob(["Blob's data"], { "type" : "text/plain" });
-checkFetchResponse(URL.createObjectURL(blob), "Blob's data", "text/plain",  blob.size,
-                  "Fetching [GET] URL.createObjectURL(blob) is OK");
-
-function checkKoUrl(url, method, desc) {
-  promise_test(function(test) {
-    var promise = fetch(url, {"method": method});
-    return promise_rejects(test, new TypeError(), promise);
-  }, desc);
-}
-
-var blob2 = new Blob(["Blob's data"], { "type" : "text/plain" });
-checkKoUrl("blob:http://{{domains[www]}}:{{ports[http][0]}}/", "GET",
-          "Fetching [GET] blob:http://{{domains[www]}}:{{ports[http][0]}}/ is KO");
-
-var invalidRequestMethods = [
-  "POST",
-  "OPTIONS",
-  "HEAD",
-  "PUT",
-  "DELETE",
-  "INVALID",
-];
-invalidRequestMethods.forEach(function(method) {
-  checkKoUrl(URL.createObjectURL(blob2), method, "Fetching [" + method + "] URL.createObjectURL(blob) is KO");
-});
-
-done();
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/basic/scheme-blob.sub.any.js
@@ -0,0 +1,45 @@
+// META: script=../resources/utils.js
+
+function checkFetchResponse(url, data, mime, size, desc) {
+  promise_test(function(test) {
+    size = size.toString();
+    return fetch(url).then(function(resp) {
+      assert_equals(resp.status, 200, "HTTP status is 200");
+      assert_equals(resp.type, "basic", "response type is basic");
+      assert_equals(resp.headers.get("Content-Type"), mime, "Content-Type is " + resp.headers.get("Content-Type"));
+      assert_equals(resp.headers.get("Content-Length"), size, "Content-Length is " + resp.headers.get("Content-Length"));
+      return resp.text();
+    }).then(function(bodyAsText) {
+      assert_equals(bodyAsText, data, "Response's body is " + data);
+    });
+  }, desc);
+}
+
+var blob = new Blob(["Blob's data"], { "type" : "text/plain" });
+checkFetchResponse(URL.createObjectURL(blob), "Blob's data", "text/plain",  blob.size,
+                  "Fetching [GET] URL.createObjectURL(blob) is OK");
+
+function checkKoUrl(url, method, desc) {
+  promise_test(function(test) {
+    var promise = fetch(url, {"method": method});
+    return promise_rejects(test, new TypeError(), promise);
+  }, desc);
+}
+
+var blob2 = new Blob(["Blob's data"], { "type" : "text/plain" });
+checkKoUrl("blob:http://{{domains[www]}}:{{ports[http][0]}}/", "GET",
+          "Fetching [GET] blob:http://{{domains[www]}}:{{ports[http][0]}}/ is KO");
+
+var invalidRequestMethods = [
+  "POST",
+  "OPTIONS",
+  "HEAD",
+  "PUT",
+  "DELETE",
+  "INVALID",
+];
+invalidRequestMethods.forEach(function(method) {
+  checkKoUrl(URL.createObjectURL(blob2), method, "Fetching [" + method + "] URL.createObjectURL(blob) is KO");
+});
+
+done();
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/scheme-others-worker.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch in worker: urls with unsupported schemes</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script>
-      fetch_tests_from_worker(new Worker("scheme-others.js?pipe=sub"));
-    </script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/scheme-others.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Fetch: urls with unsupported schemes</title>
-    <meta name="help" href="https://fetch.spec.whatwg.org/#main-fetch">
-    <meta name="help" href="https://fetch.spec.whatwg.org/#basic-fetch">
-    <meta name="author" title="Canon Research France" href="https://www.crf.canon.fr">
-    <script src="/resources/testharness.js"></script>
-    <script src="/resources/testharnessreport.js"></script>
-  </head>
-  <body>
-    <script src="../resources/utils.js"></script>
-    <script src="scheme-others.js?pipe=sub"></script>
-  </body>
-</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/fetch/api/basic/scheme-others.js
+++ /dev/null
@@ -1,33 +0,0 @@
-if (this.document === undefined) {
-  importScripts("/resources/testharness.js");
-  importScripts("../resources/utils.js");
-}
-
-function checkKoUrl(url, desc) {
-  if (!desc)
-    desc = "Fetching " + url.substring(0, 45) + " is KO"
-  promise_test(function(test) {
-    var promise = fetch(url);
-    return promise_rejects(test, new TypeError(), promise);
-  }, desc);
-}
-
-var urlWithoutScheme = "://{{host}}:{{ports[http][0]}}/";
-checkKoUrl("aaa" + urlWithoutScheme);
-checkKoUrl("cap" + urlWithoutScheme);
-checkKoUrl("cid" + urlWithoutScheme);
-checkKoUrl("dav" + urlWithoutScheme);
-checkKoUrl("dict" + urlWithoutScheme);
-checkKoUrl("dns" + urlWithoutScheme);
-checkKoUrl("geo" + urlWithoutScheme);
-checkKoUrl("im" + urlWithoutScheme);
-checkKoUrl("imap" + urlWithoutScheme);
-checkKoUrl("ipp" + urlWithoutScheme);
-checkKoUrl("ldap" + urlWithoutScheme);
-checkKoUrl("mailto" + urlWithoutScheme);
-checkKoUrl("nfs" + urlWithoutScheme);
-checkKoUrl("pop" + urlWithoutScheme);
-checkKoUrl("rtsp" + urlWithoutScheme);
-checkKoUrl("snmp" + urlWithoutScheme);
-
-done();
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fetch/api/basic/scheme-others.sub.any.js
@@ -0,0 +1,30 @@
+// META: script=../resources/utils.js
+
+function checkKoUrl(url, desc) {
+  if (!desc)
+    desc = "Fetching " + url.substring(0, 45) + " is KO"
+  promise_test(function(test) {
+    var promise = fetch(url);
+    return promise_rejects(test, new TypeError(), promise);
+  }, desc);
+}
+
+var urlWithoutScheme = "://{{host}}:{{ports[http][0]}}/";
+checkKoUrl("aaa" + urlWithoutScheme);
+checkKoUrl("cap" + urlWithoutScheme);
+checkKoUrl("cid" + urlWithoutScheme);
+checkKoUrl("dav" + urlWithoutScheme);
+checkKoUrl("dict" + urlWithoutScheme);
+checkKoUrl("dns" + urlWithoutScheme);
+checkKoUrl("geo" + urlWithoutScheme);
+checkKoUrl("im" + urlWithoutScheme);
+checkKoUrl("imap" + urlWithoutScheme);
+checkKoUrl("ipp" + urlWithoutScheme);
+checkKoUrl("ldap" + urlWithoutScheme);
+checkKoUrl("mailto" + urlWithoutScheme);
+checkKoUrl("nfs" + urlWithoutScheme);
+checkKoUrl("pop" + urlWithoutScheme);
+checkKoUrl("rtsp" + urlWithoutScheme);
+checkKoUrl("snmp" + urlWithoutScheme);
+
+done();