mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-29 09:52:50 -10:00
If multi e10s is enabled, service worker debugging is unavailable. We temporarily disabled the start/push/debug buttons in about:debugging for all service workers if multi-e10s is on. A warning section is also displayed on top of about:debugging, letting the user know that they can set dom.ipc.processCount to 1 in order to force a single content process and restore debugging capabilities. MozReview-Commit-ID: IPAlbOq2Hij
44 lines
1.5 KiB
JavaScript
44 lines
1.5 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
"use strict";
|
|
|
|
// Service workers can't be loaded from chrome://,
|
|
// but http:// is ok with dom.serviceWorkers.testing.enabled turned on.
|
|
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 serviceWorkersElement = getServiceWorkerList(document);
|
|
|
|
yield waitForMutation(serviceWorkersElement, { childList: true });
|
|
|
|
// Check that the service worker appears in the UI
|
|
let names = [...document.querySelectorAll("#service-workers .target-name")];
|
|
names = names.map(element => element.textContent);
|
|
ok(names.includes(SERVICE_WORKER),
|
|
"The service worker url appears in the list: " + names);
|
|
|
|
try {
|
|
yield unregisterServiceWorker(swTab, serviceWorkersElement);
|
|
ok(true, "Service worker registration unregistered");
|
|
} catch (e) {
|
|
ok(false, "SW not unregistered; " + e);
|
|
}
|
|
|
|
// Check that the service worker disappeared from the UI
|
|
names = [...document.querySelectorAll("#service-workers .target-name")];
|
|
names = names.map(element => element.textContent);
|
|
ok(!names.includes(SERVICE_WORKER),
|
|
"The service worker url is no longer in the list: " + names);
|
|
|
|
yield removeTab(swTab);
|
|
yield closeAboutDebugging(tab);
|
|
});
|