Bug 1641796 - Add a debugger test for service worker sources on page reload r=jlast

Depends on D79053

Differential Revision: https://phabricator.services.mozilla.com/D79059
This commit is contained in:
Julian Descottes 2020-06-16 07:56:14 +00:00
Родитель 072c5a72e7
Коммит 30d3c6963b
2 изменённых файлов: 31 добавлений и 0 удалений

Просмотреть файл

@ -186,6 +186,8 @@ skip-if = true #Bug 1571994
[browser_dbg-windowless-workers.js]
[browser_dbg-windowless-workers-early-breakpoint.js]
[browser_dbg-worker-exception.js]
[browser_dbg-windowless-service-workers-reload.js]
skip-if = !serviceworker_e10s # parent intercept mode required.
[browser_dbg-windowless-service-workers.js]
skip-if = !nightly_build || (os == 'linux' && ccov) # parent intercept mode is needed bug 1588154. Bug 1613543, the test consistently timeouts on Linux coverage builds.
[browser_dbg-worker-scopes.js]

Просмотреть файл

@ -0,0 +1,29 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
// Test that service worker sources are still displayed after reloading the page
// and that we can hit breakpoints in them.
add_task(async function() {
await pushPref("devtools.debugger.features.windowless-service-workers", true);
await pushPref("devtools.debugger.workers-visible", true);
await pushPref("dom.serviceWorkers.enabled", true);
await pushPref("dom.serviceWorkers.testing.enabled", true);
const dbg = await initDebugger("doc-service-workers.html");
invokeInTab("registerWorker");
await waitForSource(dbg, "service-worker.sjs");
const workerSource = findSource(dbg, "service-worker.sjs");
await reload(dbg, "service-worker.sjs");
await addBreakpoint(dbg, "service-worker.sjs", 13);
invokeInTab("fetchFromWorker");
await waitForPaused(dbg);
assertPausedAtSourceAndLine(dbg, workerSource.id, 13);
await resume(dbg);
await waitForRequestsToSettle(dbg);
await removeTab(gBrowser.selectedTab);
});