Bug 1398484 P2 Add a WPT test that verifies importScripts() can be redirected. r=baku
authorBen Kelly <ben@wanderview.com>
Wed, 13 Sep 2017 05:53:59 -0700
changeset 430180 6c1bf4fea13b504f9adaf073bc259ca6ac1723cf
parent 430179 4a4f563364a6464965bca2a1a49b5dafe1b355cd
child 430181 142c2979af94204afd0963202c4b8f5282dfd38e
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1398484
milestone57.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 1398484 P2 Add a WPT test that verifies importScripts() can be redirected. r=baku
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/service-workers/service-worker/import-scripts-redirect.https.html
testing/web-platform/tests/service-workers/service-worker/resources/import-scripts-redirect-import.js
testing/web-platform/tests/service-workers/service-worker/resources/import-scripts-redirect-worker.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -305854,16 +305854,26 @@
      {}
     ]
    ],
    "service-workers/service-worker/resources/import-scripts-echo.py": [
     [
      {}
     ]
    ],
+   "service-workers/service-worker/resources/import-scripts-redirect-import.js": [
+    [
+     {}
+    ]
+   ],
+   "service-workers/service-worker/resources/import-scripts-redirect-worker.js": [
+    [
+     {}
+    ]
+   ],
    "service-workers/service-worker/resources/import-scripts-resource-map-worker.js": [
     [
      {}
     ]
    ],
    "service-workers/service-worker/resources/import-scripts-updated-flag-worker.js": [
     [
      {}
@@ -374799,16 +374809,22 @@
     ]
    ],
    "service-workers/service-worker/immutable-prototype-serviceworker.https.html": [
     [
      "/service-workers/service-worker/immutable-prototype-serviceworker.https.html",
      {}
     ]
    ],
+   "service-workers/service-worker/import-scripts-redirect.https.html": [
+    [
+     "/service-workers/service-worker/import-scripts-redirect.https.html",
+     {}
+    ]
+   ],
    "service-workers/service-worker/import-scripts-resource-map.https.html": [
     [
      "/service-workers/service-worker/import-scripts-resource-map.https.html",
      {}
     ]
    ],
    "service-workers/service-worker/import-scripts-updated-flag.https.html": [
     [
@@ -620398,16 +620414,20 @@
   "service-workers/service-worker/iframe-sandbox-register-link-element.https.html": [
    "6cafc3245c88f7d96f6a4672b327d3b58ee4a0ee",
    "testharness"
   ],
   "service-workers/service-worker/immutable-prototype-serviceworker.https.html": [
    "5c17042fa54cd1fdba6f7aae513412d4a223b432",
    "testharness"
   ],
+  "service-workers/service-worker/import-scripts-redirect.https.html": [
+   "4ff11da0e7ae6745232a8202cd67edaf6c5497d1",
+   "testharness"
+  ],
   "service-workers/service-worker/import-scripts-resource-map.https.html": [
    "6bc46467c667f942fd30de063806474e8c94cff0",
    "testharness"
   ],
   "service-workers/service-worker/import-scripts-updated-flag.https.html": [
    "e902940bec870cf548c576b5fd06d2e71fd3f97a",
    "testharness"
   ],
@@ -621194,16 +621214,24 @@
   "service-workers/service-worker/resources/import-mime-type-worker.py": [
    "7881cd81f7fe54bf3be799f3549098c78b896574",
    "support"
   ],
   "service-workers/service-worker/resources/import-scripts-echo.py": [
    "95d29c9b8749cabf795d9a867e260827a8360640",
    "support"
   ],
+  "service-workers/service-worker/resources/import-scripts-redirect-import.js": [
+   "34472e2e6dac507ca6c937f3ce872d0b5718b89a",
+   "support"
+  ],
+  "service-workers/service-worker/resources/import-scripts-redirect-worker.js": [
+   "f29c77e2c504ba8e5a72c260233f6deba76dfb5d",
+   "support"
+  ],
   "service-workers/service-worker/resources/import-scripts-resource-map-worker.js": [
    "bafc81b044c2a52f4ceefcd15a0b8b3c7553146e",
    "support"
   ],
   "service-workers/service-worker/resources/import-scripts-updated-flag-worker.js": [
    "b83d48b7ed268293b4788e36bcd7293b1b15e751",
    "support"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/import-scripts-redirect.https.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Tests for importScripts: redirect</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/test-helpers.sub.js"></script>
+<body>
+<script>
+promise_test(async t => {
+    const scope = 'resources/import-scripts-redirect';
+    await service_worker_unregister(t, scope);
+    let reg = await navigator.serviceWorker.register(
+      'resources/import-scripts-redirect-worker.js', { scope: scope });
+    assert_not_equals(reg.installing, null, 'worker is installing');
+    await reg.unregister();
+  }, 'importScripts() supports redirects');
+</script>
+</body>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/import-scripts-redirect-import.js
@@ -0,0 +1,1 @@
+// empty script
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/service-workers/service-worker/resources/import-scripts-redirect-worker.js
@@ -0,0 +1,1 @@
+importScripts('redirect.py?Redirect=import-scripts-redirect-import.js');