Bug 1184607 P8 Fix mochitests to store opaqueredirect responses in Cache for navigation URLs. r=nsm
authorBen Kelly <ben@wanderview.com>
Mon, 31 Aug 2015 14:26:30 -0700
changeset 260229 e330761d6058b0ad78594fa0333a3c400e90d4f6
parent 260228 ed9da75e6f6e8d85e98fa8e219e2a3b058b0f90a
child 260230 0f3779b36cb2799fba12a6e7a3d9e8747d67230f
push id29304
push usercbook@mozilla.com
push dateTue, 01 Sep 2015 12:32:25 +0000
treeherdermozilla-central@dd509db16a13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnsm
bugs1184607
milestone43.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 1184607 P8 Fix mochitests to store opaqueredirect responses in Cache for navigation URLs. r=nsm
dom/workers/test/serviceworkers/fetch/origin/https/origin_test.js
dom/workers/test/serviceworkers/fetch/origin/https/realindex.html^headers^
dom/workers/test/serviceworkers/fetch/origin/origin_test.js
dom/workers/test/serviceworkers/fetch/origin/realindex.html^headers^
dom/workers/test/serviceworkers/mochitest.ini
--- a/dom/workers/test/serviceworkers/fetch/origin/https/origin_test.js
+++ b/dom/workers/test/serviceworkers/fetch/origin/https/origin_test.js
@@ -1,15 +1,16 @@
 var prefix = "/tests/dom/workers/test/serviceworkers/fetch/origin/https/";
 
 self.addEventListener("install", function(event) {
   event.waitUntil(
     self.caches.open("origin-cache")
       .then(c => {
-        return c.add(prefix + 'index-https.sjs');
+        return c.add(new Request(prefix + 'index-https.sjs',
+                                 { redirect: 'manual' }));
       })
   );
 });
 
 self.addEventListener("fetch", function(event) {
   if (event.request.url.indexOf("index-cached-https.sjs") >= 0) {
     event.respondWith(
       self.caches.open("origin-cache")
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/fetch/origin/https/realindex.html^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Access-Control-Allow-Origin: https://example.com
--- a/dom/workers/test/serviceworkers/fetch/origin/origin_test.js
+++ b/dom/workers/test/serviceworkers/fetch/origin/origin_test.js
@@ -1,18 +1,20 @@
 var prefix = "/tests/dom/workers/test/serviceworkers/fetch/origin/";
 
 self.addEventListener("install", function(event) {
   event.waitUntil(
     self.caches.open("origin-cache")
       .then(c => {
         return Promise.all(
           [
-            c.add(prefix + 'index.sjs'),
-            c.add(prefix + 'index-to-https.sjs'),
+            c.add(new Request(prefix + 'index.sjs',
+                              { redirect: 'manual' } )),
+            c.add(new Request(prefix + 'index-to-https.sjs',
+                              { redirect: 'manual' } ))
           ]
         );
       })
   );
 });
 
 self.addEventListener("fetch", function(event) {
   if (event.request.url.indexOf("index-cached.sjs") >= 0) {
deleted file mode 100644
--- a/dom/workers/test/serviceworkers/fetch/origin/realindex.html^headers^
+++ /dev/null
@@ -1,1 +0,0 @@
-Access-Control-Allow-Origin: http://mochi.test:8888
--- a/dom/workers/test/serviceworkers/mochitest.ini
+++ b/dom/workers/test/serviceworkers/mochitest.ini
@@ -48,23 +48,21 @@ support-files =
   fetch/https/https_test.js
   fetch/https/clonedresponse/index.html
   fetch/https/clonedresponse/register.html
   fetch/https/clonedresponse/unregister.html
   fetch/https/clonedresponse/https_test.js
   fetch/origin/index.sjs
   fetch/origin/index-to-https.sjs
   fetch/origin/realindex.html
-  fetch/origin/realindex.html^headers^
   fetch/origin/register.html
   fetch/origin/unregister.html
   fetch/origin/origin_test.js
   fetch/origin/https/index-https.sjs
   fetch/origin/https/realindex.html
-  fetch/origin/https/realindex.html^headers^
   fetch/origin/https/register.html
   fetch/origin/https/unregister.html
   fetch/origin/https/origin_test.js
   fetch/requesturl/index.html
   fetch/requesturl/redirect.sjs
   fetch/requesturl/redirector.html
   fetch/requesturl/register.html
   fetch/requesturl/requesturl_test.js