# HG changeset patch # User Ben Kelly # Date 1517000939 28800 # Node ID c8f0fb23b6e4156eb684e39456b4ab2e2dd830f2 # Parent 018285a507a4f64c823f06e181084733b6bb5399 Bug 1430139 P4 Fix mochitest paths for new dom/serviceworkers location. r=asuth diff --git a/dom/serviceworkers/test/browser_devtools_serviceworker_interception.js b/dom/serviceworkers/test/browser_devtools_serviceworker_interception.js --- a/dom/serviceworkers/test/browser_devtools_serviceworker_interception.js +++ b/dom/serviceworkers/test/browser_devtools_serviceworker_interception.js @@ -1,17 +1,17 @@ "use strict"; const BASE_URI = - "http://mochi.test:8888/browser/dom/workers/test/serviceworkers/"; + "http://mochi.test:8888/browser/dom/serviceworkers/test/"; const emptyDoc = BASE_URI + "empty.html"; const fakeDoc = BASE_URI + "fake.html"; const helloDoc = BASE_URI + "hello.html"; -const CROSS_URI = "http://example.com/browser/dom/workers/test/serviceworkers/"; +const CROSS_URI = "http://example.com/browser/dom/serviceworkers/test/"; const crossRedirect = CROSS_URI + "redirect"; const crossHelloDoc = CROSS_URI + "hello.html"; const sw = BASE_URI + "fetch.js"; // XXXtt: We should be able to move this check to chrome process after we move // the interception logic to chrome process. async function checkObserverInContent(aInput) { diff --git a/dom/serviceworkers/test/browser_storage_permission.js b/dom/serviceworkers/test/browser_storage_permission.js --- a/dom/serviceworkers/test/browser_storage_permission.js +++ b/dom/serviceworkers/test/browser_storage_permission.js @@ -1,13 +1,13 @@ "use strict"; const { interfaces: Ci } = Components; -const BASE_URI = "http://mochi.test:8888/browser/dom/workers/test/serviceworkers/"; +const BASE_URI = "http://mochi.test:8888/browser/dom/serviceworkers/test/"; const PAGE_URI = BASE_URI + "empty.html"; const SCOPE = PAGE_URI + "?storage_permission"; const SW_SCRIPT = BASE_URI + "empty.js"; add_task(async function setup() { await SpecialPowers.pushPrefEnv({"set": [ // Until the e10s refactor is complete, use a single process to avoid diff --git a/dom/serviceworkers/test/browser_unregister_with_containers.js b/dom/serviceworkers/test/browser_unregister_with_containers.js --- a/dom/serviceworkers/test/browser_unregister_with_containers.js +++ b/dom/serviceworkers/test/browser_unregister_with_containers.js @@ -1,13 +1,13 @@ "use strict"; const { interfaces: Ci } = Components; -const BASE_URI = "http://mochi.test:8888/browser/dom/workers/test/serviceworkers/"; +const BASE_URI = "http://mochi.test:8888/browser/dom/serviceworkers/test/"; const PAGE_URI = BASE_URI + "empty.html"; const SCOPE = PAGE_URI + "?unregister_with_containers"; const SW_SCRIPT = BASE_URI + "empty.js"; function doRegister(browser) { return ContentTask.spawn(browser, { script: SW_SCRIPT, scope: SCOPE }, async function(opts) { let reg = await content.navigator.serviceWorker.register(opts.script, diff --git a/dom/serviceworkers/test/browser_userContextId_openWindow.js b/dom/serviceworkers/test/browser_userContextId_openWindow.js --- a/dom/serviceworkers/test/browser_userContextId_openWindow.js +++ b/dom/serviceworkers/test/browser_userContextId_openWindow.js @@ -1,14 +1,14 @@ let { classes: Cc, interfaces: Ci, manager: Cm, results: Cr } = Components; let swm = Cc["@mozilla.org/serviceworkers/manager;1"]. getService(Ci.nsIServiceWorkerManager); -const URI = "https://example.com/browser/dom/workers/test/serviceworkers/empty.html"; +const URI = "https://example.com/browser/dom/serviceworkers/test/empty.html"; const MOCK_CID = Components.ID("{2a0f83c4-8818-4914-a184-f1172b4eaaa7}"); const ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/alerts-service;1"; const USER_CONTEXT_ID = 3 let mockAlertsService = { showAlert: function(alert, alertListener) { ok(true, "Showing alert"); setTimeout(function () { diff --git a/dom/serviceworkers/test/chrome_helpers.js b/dom/serviceworkers/test/chrome_helpers.js --- a/dom/serviceworkers/test/chrome_helpers.js +++ b/dom/serviceworkers/test/chrome_helpers.js @@ -1,12 +1,12 @@ let swm = Cc["@mozilla.org/serviceworkers/manager;1"]. getService(Ci.nsIServiceWorkerManager); -let EXAMPLE_URL = "https://example.com/chrome/dom/workers/test/serviceworkers/"; +let EXAMPLE_URL = "https://example.com/chrome/dom/serviceworkers/test/"; function waitForIframeLoad(iframe) { return new Promise(function (resolve) { iframe.onload = resolve; }); } function waitForRegister(scope, callback) { diff --git a/dom/serviceworkers/test/controller/index.html b/dom/serviceworkers/test/controller/index.html --- a/dom/serviceworkers/test/controller/index.html +++ b/dom/serviceworkers/test/controller/index.html @@ -20,17 +20,17 @@ parent.postMessage({status: "ok", result: result, message: msg}, "*"); } function finish() { parent.postMessage({status: "done"}, "*"); } navigator.serviceWorker.ready.then(function(swr) { - my_ok(swr.scope.match(/serviceworkers\/control$/), + my_ok(swr.scope.match(/serviceworkers\/test\/control$/), "This page should be controlled by upper level registration"); my_ok(swr.installing == undefined, "Upper level registration should not have a installing worker."); if (navigator.serviceWorker.controller) { // We are controlled. // Register a new worker for this sub-scope. After that, controller should still be for upper level, but active should change to be this scope's. navigator.serviceWorker.register("../worker2.js", { scope: "./" }).then(function(e) { my_ok("installing" in e, "ServiceWorkerRegistration.installing exists."); @@ -39,17 +39,17 @@ my_ok("waiting" in e, "ServiceWorkerRegistration.waiting exists."); my_ok("active" in e, "ServiceWorkerRegistration.active exists."); my_ok(e.installing && e.installing.scriptURL.match(/worker2.js$/), "Installing is serviceworker/controller"); my_ok("scope" in e, "ServiceWorkerRegistration.scope exists."); - my_ok(e.scope.match(/serviceworkers\/controller\/$/), "Scope is serviceworker/controller " + e.scope); + my_ok(e.scope.match(/serviceworkers\/test\/controller\/$/), "Scope is serviceworker/test/controller " + e.scope); my_ok("unregister" in e, "ServiceWorkerRegistration.unregister exists."); my_ok(navigator.serviceWorker.controller.scriptURL.match(/worker\.js$/), "Controller is still worker.js"); e.unregister().then(function(result) { my_ok(result, "Unregistering the SW should succeed"); diff --git a/dom/serviceworkers/test/eventsource/eventsource_cors_response.html b/dom/serviceworkers/test/eventsource/eventsource_cors_response.html --- a/dom/serviceworkers/test/eventsource/eventsource_cors_response.html +++ b/dom/serviceworkers/test/eventsource/eventsource_cors_response.html @@ -3,17 +3,17 @@ http://creativecommons.org/publicdomain/zero/1.0/ --> Bug 1182103 - Test EventSource scenarios with fetch interception - + diff --git a/dom/serviceworkers/test/fetch/hsts/image.html b/dom/serviceworkers/test/fetch/hsts/image.html --- a/dom/serviceworkers/test/fetch/hsts/image.html +++ b/dom/serviceworkers/test/fetch/hsts/image.html @@ -1,13 +1,13 @@ diff --git a/dom/serviceworkers/test/fetch/origin/https/index-https.sjs b/dom/serviceworkers/test/fetch/origin/https/index-https.sjs --- a/dom/serviceworkers/test/fetch/origin/https/index-https.sjs +++ b/dom/serviceworkers/test/fetch/origin/https/index-https.sjs @@ -1,4 +1,4 @@ function handleRequest(request, response) { response.setStatusLine(null, 308, "Permanent Redirect"); - response.setHeader("Location", "https://example.org/tests/dom/workers/test/serviceworkers/fetch/origin/https/realindex.html", false); + response.setHeader("Location", "https://example.org/tests/dom/serviceworkers/test/fetch/origin/https/realindex.html", false); } diff --git a/dom/serviceworkers/test/fetch/origin/https/origin_test.js b/dom/serviceworkers/test/fetch/origin/https/origin_test.js --- a/dom/serviceworkers/test/fetch/origin/https/origin_test.js +++ b/dom/serviceworkers/test/fetch/origin/https/origin_test.js @@ -1,9 +1,9 @@ -var prefix = "/tests/dom/workers/test/serviceworkers/fetch/origin/https/"; +var prefix = "/tests/dom/serviceworkers/test/fetch/origin/https/"; function addOpaqueRedirect(cache, file) { return fetch(new Request(prefix + file, { redirect: "manual" })).then(function(response) { return cache.put(prefix + file, response); }); } self.addEventListener("install", function(event) { diff --git a/dom/serviceworkers/test/fetch/origin/index-to-https.sjs b/dom/serviceworkers/test/fetch/origin/index-to-https.sjs --- a/dom/serviceworkers/test/fetch/origin/index-to-https.sjs +++ b/dom/serviceworkers/test/fetch/origin/index-to-https.sjs @@ -1,4 +1,4 @@ function handleRequest(request, response) { response.setStatusLine(null, 308, "Permanent Redirect"); - response.setHeader("Location", "https://example.org/tests/dom/workers/test/serviceworkers/fetch/origin/realindex.html", false); + response.setHeader("Location", "https://example.org/tests/dom/serviceworkers/test/fetch/origin/realindex.html", false); } diff --git a/dom/serviceworkers/test/fetch/origin/index.sjs b/dom/serviceworkers/test/fetch/origin/index.sjs --- a/dom/serviceworkers/test/fetch/origin/index.sjs +++ b/dom/serviceworkers/test/fetch/origin/index.sjs @@ -1,4 +1,4 @@ function handleRequest(request, response) { response.setStatusLine(null, 308, "Permanent Redirect"); - response.setHeader("Location", "http://example.org/tests/dom/workers/test/serviceworkers/fetch/origin/realindex.html", false); + response.setHeader("Location", "http://example.org/tests/dom/serviceworkers/test/fetch/origin/realindex.html", false); } diff --git a/dom/serviceworkers/test/fetch/origin/origin_test.js b/dom/serviceworkers/test/fetch/origin/origin_test.js --- a/dom/serviceworkers/test/fetch/origin/origin_test.js +++ b/dom/serviceworkers/test/fetch/origin/origin_test.js @@ -1,9 +1,9 @@ -var prefix = "/tests/dom/workers/test/serviceworkers/fetch/origin/"; +var prefix = "/tests/dom/serviceworkers/test/fetch/origin/"; function addOpaqueRedirect(cache, file) { return fetch(new Request(prefix + file, { redirect: "manual" })).then(function(response) { return cache.put(prefix + file, response); }); } self.addEventListener("install", function(event) { diff --git a/dom/serviceworkers/test/fetch/requesturl/redirect.sjs b/dom/serviceworkers/test/fetch/requesturl/redirect.sjs --- a/dom/serviceworkers/test/fetch/requesturl/redirect.sjs +++ b/dom/serviceworkers/test/fetch/requesturl/redirect.sjs @@ -1,4 +1,4 @@ function handleRequest(request, response) { response.setStatusLine(null, 308, "Permanent Redirect"); - response.setHeader("Location", "http://example.org/tests/dom/workers/test/serviceworkers/fetch/requesturl/secret.html", false); + response.setHeader("Location", "http://example.org/tests/dom/serviceworkers/test/fetch/requesturl/secret.html", false); } diff --git a/dom/serviceworkers/test/fetch/requesturl/redirector.html b/dom/serviceworkers/test/fetch/requesturl/redirector.html --- a/dom/serviceworkers/test/fetch/requesturl/redirector.html +++ b/dom/serviceworkers/test/fetch/requesturl/redirector.html @@ -1,2 +1,2 @@ - + diff --git a/dom/serviceworkers/test/fetch/upgrade-insecure/embedder.html b/dom/serviceworkers/test/fetch/upgrade-insecure/embedder.html --- a/dom/serviceworkers/test/fetch/upgrade-insecure/embedder.html +++ b/dom/serviceworkers/test/fetch/upgrade-insecure/embedder.html @@ -2,9 +2,9 @@ - + diff --git a/dom/serviceworkers/test/fetch/upgrade-insecure/image.html b/dom/serviceworkers/test/fetch/upgrade-insecure/image.html --- a/dom/serviceworkers/test/fetch/upgrade-insecure/image.html +++ b/dom/serviceworkers/test/fetch/upgrade-insecure/image.html @@ -1,13 +1,13 @@ diff --git a/dom/serviceworkers/test/fetch_event_worker.js b/dom/serviceworkers/test/fetch_event_worker.js --- a/dom/serviceworkers/test/fetch_event_worker.js +++ b/dom/serviceworkers/test/fetch_event_worker.js @@ -318,17 +318,17 @@ onfetch = function(ev) { } else if (ev.request.url.includes('somethingelse.txt')) { ev.respondWith(new Response('something else response body', {})); } else if (ev.request.url.includes('redirect_serviceworker.sjs')) { // The redirect_serviceworker.sjs server-side JavaScript file redirects to - // 'http://mochi.test:8888/tests/dom/workers/test/serviceworkers/worker.js' + // 'http://mochi.test:8888/tests/dom/serviceworkers/test/worker.js' // The redirected fetch should not go through the SW since the original // fetch was initiated from a SW. ev.respondWith(fetch('redirect_serviceworker.sjs')); } else if (ev.request.url.includes('load_cross_origin_xml_document_synthetic.xml')) { if (ev.request.mode != 'same-origin') { ev.respondWith(Promise.reject()); diff --git a/dom/serviceworkers/test/isolated/multi-e10s-update/browser_multie10s_update.js b/dom/serviceworkers/test/isolated/multi-e10s-update/browser_multie10s_update.js --- a/dom/serviceworkers/test/isolated/multi-e10s-update/browser_multie10s_update.js +++ b/dom/serviceworkers/test/isolated/multi-e10s-update/browser_multie10s_update.js @@ -1,15 +1,15 @@ "use strict"; // Testing if 2 child processes are correctly managed when they both try to do // an SW update. const BASE_URI = - "http://mochi.test:8888/browser/dom/workers/test/serviceworkers/isolated/multi-e10s-update/"; + "http://mochi.test:8888/browser/dom/serviceworkers/test/isolated/multi-e10s-update/"; add_task(async function test_update() { info("Setting the prefs to having multi-e10s enabled"); await SpecialPowers.pushPrefEnv({"set": [ ["dom.ipc.processCount", 4], ["dom.serviceWorkers.enabled", true], ["dom.serviceWorkers.testing.enabled", true], ]}); diff --git a/dom/serviceworkers/test/opaque_intercept_worker.js b/dom/serviceworkers/test/opaque_intercept_worker.js --- a/dom/serviceworkers/test/opaque_intercept_worker.js +++ b/dom/serviceworkers/test/opaque_intercept_worker.js @@ -1,12 +1,12 @@ var name = 'opaqueInterceptCache'; // Cross origin request to ensure that an opaque response is used -var prefix = 'http://example.com/tests/dom/workers/test/serviceworkers/' +var prefix = 'http://example.com/tests/dom/serviceworkers/test/' self.addEventListener('install', function(event) { var request = new Request(prefix + 'notify_loaded.js', { mode: 'no-cors' }); event.waitUntil( Promise.all([caches.open(name), fetch(request)]).then(function(results) { var cache = results[0]; var response = results[1]; return cache.put('./sw_clients/does_not_exist.js', response); diff --git a/dom/serviceworkers/test/openWindow_worker.js b/dom/serviceworkers/test/openWindow_worker.js --- a/dom/serviceworkers/test/openWindow_worker.js +++ b/dom/serviceworkers/test/openWindow_worker.js @@ -83,20 +83,20 @@ onmessage = function(event) { })); } } onnotificationclick = function(e) { var results = []; var promises = []; - var redirect = "http://mochi.test:8888/tests/dom/workers/test/serviceworkers/redirect.sjs?" - var redirect_xorigin = "http://example.com/tests/dom/workers/test/serviceworkers/redirect.sjs?" - var same_origin = "http://mochi.test:8888/tests/dom/workers/test/serviceworkers/open_window/client.html" - var different_origin = "http://example.com/tests/dom/workers/test/serviceworkers/open_window/client.html" + var redirect = "http://mochi.test:8888/tests/dom/serviceworkers/test/redirect.sjs?" + var redirect_xorigin = "http://example.com/tests/dom/serviceworkers/test/redirect.sjs?" + var same_origin = "http://mochi.test:8888/tests/dom/serviceworkers/test/open_window/client.html" + var different_origin = "http://example.com/tests/dom/serviceworkers/test/open_window/client.html" promises.push(testForUrl("about:blank", "TypeError", null, results)); promises.push(testForUrl(different_origin, null, null, results)); promises.push(testForUrl(same_origin, null, {url: same_origin}, results)); promises.push(testForUrl("open_window/client.html", null, {url: same_origin}, results)); // redirect tests diff --git a/dom/serviceworkers/test/open_window/client.html b/dom/serviceworkers/test/open_window/client.html --- a/dom/serviceworkers/test/open_window/client.html +++ b/dom/serviceworkers/test/open_window/client.html @@ -9,17 +9,17 @@


 
 
 
 
diff --git a/dom/serviceworkers/test/redirect_post.sjs b/dom/serviceworkers/test/redirect_post.sjs
--- a/dom/serviceworkers/test/redirect_post.sjs
+++ b/dom/serviceworkers/test/redirect_post.sjs
@@ -18,17 +18,17 @@ function handleRequest(request, response
 
   var body = decodeURIComponent(
     escape(String.fromCharCode.apply(null, bodyBytes)));
 
   var currentHop = query.hop ? parseInt(query.hop) : 0;
 
   var obj = JSON.parse(body);
   if (currentHop < obj.hops) {
-    var newURL = '/tests/dom/workers/test/serviceworkers/redirect_post.sjs?hop=' +
+    var newURL = '/tests/dom/serviceworkers/test/redirect_post.sjs?hop=' +
                  (1 + currentHop);
     response.setStatusLine(null, 307, 'redirect');
     response.setHeader('Location', newURL);
     return;
   }
 
   response.setHeader('Content-Type', 'application/json');
   response.write(body);
diff --git a/dom/serviceworkers/test/redirect_serviceworker.sjs b/dom/serviceworkers/test/redirect_serviceworker.sjs
--- a/dom/serviceworkers/test/redirect_serviceworker.sjs
+++ b/dom/serviceworkers/test/redirect_serviceworker.sjs
@@ -1,4 +1,4 @@
 function handleRequest(request, response) {
   response.setStatusLine("1.1", 302, "Found");
-  response.setHeader("Location", "http://mochi.test:8888/tests/dom/workers/test/serviceworkers/worker.js");
+  response.setHeader("Location", "http://mochi.test:8888/tests/dom/serviceworkers/test/worker.js");
 }
diff --git a/dom/serviceworkers/test/simpleregister/index.html b/dom/serviceworkers/test/simpleregister/index.html
--- a/dom/serviceworkers/test/simpleregister/index.html
+++ b/dom/serviceworkers/test/simpleregister/index.html
@@ -22,17 +22,17 @@
               if (a[i].scope.match(/simpleregister\//)) {
                 a[i].onupdatefound = function(e) {
                   eventReceived();
                 }
               }
             }
           });
 
-          navigator.serviceWorker.getRegistration('http://mochi.test:8888/tests/dom/workers/test/serviceworkers/simpleregister/')
+          navigator.serviceWorker.getRegistration('http://mochi.test:8888/tests/dom/serviceworkers/test/simpleregister/')
             .then(function(a) {
             window.parent.postMessage({ type: "check", status: a instanceof ServiceWorkerRegistration,
                                         msg: "getRegistration returns a ServiceWorkerRegistration" }, "*");
             a.onupdatefound = function(e) {
               eventReceived();
             }
           });
 
diff --git a/dom/serviceworkers/test/sw_clients/file_blob_upload_frame.html b/dom/serviceworkers/test/sw_clients/file_blob_upload_frame.html
--- a/dom/serviceworkers/test/sw_clients/file_blob_upload_frame.html
+++ b/dom/serviceworkers/test/sw_clients/file_blob_upload_frame.html
@@ -49,17 +49,17 @@ function makeFileBlob(obj) {
     };
   });
 }
 
 navigator.serviceWorker.ready.then(function() {
   parent.postMessage({ status: 'READY' }, '*');
 });
 
-var URL = '/tests/dom/workers/test/serviceworkers/redirect_post.sjs';
+var URL = '/tests/dom/serviceworkers/test/redirect_post.sjs';
 
 addEventListener('message', function(evt) {
   if (evt.data.type = 'TEST') {
     makeFileBlob(evt.data.body).then(function(blob) {
       return fetch(URL, { method: 'POST', body: blob });
     }).then(function(response) {
       return response.json();
     }).then(function(result) {
diff --git a/dom/serviceworkers/test/swa/worker_scope_precise.js^headers^ b/dom/serviceworkers/test/swa/worker_scope_precise.js^headers^
--- a/dom/serviceworkers/test/swa/worker_scope_precise.js^headers^
+++ b/dom/serviceworkers/test/swa/worker_scope_precise.js^headers^
@@ -1,1 +1,1 @@
-Service-Worker-Allowed: /tests/dom/workers/test/serviceworkers/swa
+Service-Worker-Allowed: /tests/dom/serviceworkers/test/swa
diff --git a/dom/serviceworkers/test/swa/worker_scope_too_deep.js^headers^ b/dom/serviceworkers/test/swa/worker_scope_too_deep.js^headers^
--- a/dom/serviceworkers/test/swa/worker_scope_too_deep.js^headers^
+++ b/dom/serviceworkers/test/swa/worker_scope_too_deep.js^headers^
@@ -1,1 +1,1 @@
-Service-Worker-Allowed: /tests/dom/workers/test/serviceworkers/swa/deep/way/too/specific
+Service-Worker-Allowed: /tests/dom/serviceworkers/test/swa/deep/way/too/specific
diff --git a/dom/serviceworkers/test/swa/worker_scope_too_narrow.js^headers^ b/dom/serviceworkers/test/swa/worker_scope_too_narrow.js^headers^
--- a/dom/serviceworkers/test/swa/worker_scope_too_narrow.js^headers^
+++ b/dom/serviceworkers/test/swa/worker_scope_too_narrow.js^headers^
@@ -1,1 +1,1 @@
-Service-Worker-Allowed: /tests/dom/workers
+Service-Worker-Allowed: /tests/dom/serviceworkers
diff --git a/dom/serviceworkers/test/test_cookie_fetch.html b/dom/serviceworkers/test/test_cookie_fetch.html
--- a/dom/serviceworkers/test/test_cookie_fetch.html
+++ b/dom/serviceworkers/test/test_cookie_fetch.html
@@ -15,32 +15,35 @@