Bug 1425393 - open sw tabs in background in about:debugging tests;r=ochameau
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 12 Dec 2017 15:49:36 -0600
changeset 449491 00b1cae7d55f4ee710702b0ec382d53698727f26
parent 449490 e6aed81c3f0469c45f3f93d08d580a879c06870e
child 449492 34d4a9907d4f2a1d76d173aee0768ef18b173f08
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1425393
milestone59.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 1425393 - open sw tabs in background in about:debugging tests;r=ochameau MozReview-Commit-ID: 8UyrTDtHa7b
devtools/client/aboutdebugging/test/browser_service_workers.js
devtools/client/aboutdebugging/test/browser_service_workers_fetch_flag.js
devtools/client/aboutdebugging/test/browser_service_workers_push.js
devtools/client/aboutdebugging/test/browser_service_workers_push_service.js
devtools/client/aboutdebugging/test/browser_service_workers_start.js
devtools/client/aboutdebugging/test/browser_service_workers_status.js
devtools/client/aboutdebugging/test/browser_service_workers_timeout.js
devtools/client/aboutdebugging/test/browser_service_workers_unregister.js
--- a/devtools/client/aboutdebugging/test/browser_service_workers.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers.js
@@ -8,17 +8,17 @@
 const SERVICE_WORKER = URL_ROOT + "service-workers/empty-sw.js";
 const TAB_URL = URL_ROOT + "service-workers/empty-sw.html";
 
 add_task(function* () {
   yield enableServiceWorkerDebugging();
 
   let { tab, document } = yield openAboutDebugging("workers");
 
-  let swTab = yield addTab(TAB_URL);
+  let swTab = yield addTab(TAB_URL, { background: true });
 
   let serviceWorkersElement = getServiceWorkerList(document);
 
   yield waitUntil(() => {
     // Check that the service worker appears in the UI
     let names = [...document.querySelectorAll("#service-workers .target-name")];
     names = names.map(element => element.textContent);
     return names.includes(SERVICE_WORKER);
--- a/devtools/client/aboutdebugging/test/browser_service_workers_fetch_flag.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_fetch_flag.js
@@ -7,17 +7,17 @@
 // but http:// is ok with dom.serviceWorkers.testing.enabled turned on.
 const EMPTY_SW_TAB_URL = URL_ROOT + "service-workers/empty-sw.html";
 const FETCH_SW_TAB_URL = URL_ROOT + "service-workers/fetch-sw.html";
 
 function* testBody(url, expecting) {
   yield enableServiceWorkerDebugging();
   let { tab, document } = yield openAboutDebugging("workers");
 
-  let swTab = yield addTab(url);
+  let swTab = yield addTab(url, {background: true});
 
   let serviceWorkersElement = getServiceWorkerList(document);
 
   info("Wait for fetch flag.");
   yield waitUntil(() => {
     let fetchFlags =
       [...document.querySelectorAll("#service-workers .service-worker-fetch-flag")];
     fetchFlags = fetchFlags.map(element => element.textContent);
--- a/devtools/client/aboutdebugging/test/browser_service_workers_push.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_push.js
@@ -17,17 +17,17 @@ const TAB_URL = URL_ROOT + "service-work
 add_task(function* () {
   yield enableServiceWorkerDebugging();
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = getServiceWorkerList(document);
 
   // Open a tab that registers a push service worker.
-  let swTab = yield addTab(TAB_URL);
+  let swTab = yield addTab(TAB_URL, { background: true });
 
   info("Make the test page notify us when the service worker sends a message.");
 
   yield ContentTask.spawn(swTab.linkedBrowser, {}, function () {
     let win = content.wrappedJSObject;
     win.navigator.serviceWorker.addEventListener("message", function (event) {
       sendAsyncMessage(event.data);
     });
--- a/devtools/client/aboutdebugging/test/browser_service_workers_push_service.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_push_service.js
@@ -53,17 +53,17 @@ add_task(function* () {
   };
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = document.getElementById("service-workers");
 
   // Open a tab that registers a push service worker.
-  let swTab = yield addTab(TAB_URL);
+  let swTab = yield addTab(TAB_URL, { background: true });
 
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   yield waitForServiceWorkerActivation(SERVICE_WORKER, document);
 
   // Wait for the service worker details to update.
   let names = [...document.querySelectorAll("#service-workers .target-name")];
--- a/devtools/client/aboutdebugging/test/browser_service_workers_start.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_start.js
@@ -20,17 +20,17 @@ add_task(function* () {
   yield pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT);
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = getServiceWorkerList(document);
 
   // Open a tab that registers an empty service worker.
-  let swTab = yield addTab(TAB_URL);
+  let swTab = yield addTab(TAB_URL, { background: true });
 
   // Wait for the service-workers list to update.
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   info("Ensure that the registration resolved before trying to interact with " +
     "the service worker.");
   yield waitForServiceWorkerRegistered(swTab);
--- a/devtools/client/aboutdebugging/test/browser_service_workers_status.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_status.js
@@ -16,17 +16,17 @@ add_task(function* () {
   yield pushPref("dom.serviceWorkers.idle_timeout", SW_TIMEOUT);
   yield pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT);
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Listen for mutations in the service-workers list.
   let serviceWorkersElement = getServiceWorkerList(document);
 
-  let swTab = yield addTab(TAB_URL);
+  let swTab = yield addTab(TAB_URL, { background: true });
 
   info("Wait until the service worker appears in about:debugging");
   let container = yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   // We should ideally check that the service worker registration goes through the
   // "registering" and "running" steps, but it is difficult to workaround race conditions
   // for a test running on a wide variety of platforms. Due to intermittent failures, we
   // simply check that the registration transitions to "stopped".
--- a/devtools/client/aboutdebugging/test/browser_service_workers_timeout.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_timeout.js
@@ -15,17 +15,17 @@ add_task(function* () {
   yield enableServiceWorkerDebugging();
   yield pushPref("dom.serviceWorkers.idle_timeout", SW_TIMEOUT);
   yield pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT);
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   let serviceWorkersElement = getServiceWorkerList(document);
 
-  let swTab = yield addTab(TAB_URL);
+  let swTab = yield addTab(TAB_URL, { background: true });
 
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   // Ensure that the registration resolved before trying to connect to the sw
   yield waitForServiceWorkerRegistered(swTab);
   ok(true, "Service worker registration resolved");
 
--- a/devtools/client/aboutdebugging/test/browser_service_workers_unregister.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers_unregister.js
@@ -15,17 +15,17 @@ const SERVICE_WORKER = SCOPE + "empty-sw
 const TAB_URL = SCOPE + "empty-sw.html";
 
 add_task(function* () {
   yield enableServiceWorkerDebugging();
 
   let { tab, document } = yield openAboutDebugging("workers");
 
   // Open a tab that registers an empty service worker.
-  let swTab = yield addTab(TAB_URL);
+  let swTab = yield addTab(TAB_URL, { background: true });
 
   info("Wait until the service worker appears in about:debugging");
   yield waitUntilServiceWorkerContainer(SERVICE_WORKER, document);
 
   yield waitForServiceWorkerActivation(SERVICE_WORKER, document);
 
   info("Ensure that the registration resolved before trying to interact with " +
     "the service worker.");