Bug 1641796 - Add a debugger test for service worker sources on page reload r=jlast
authorJulian Descottes <jdescottes@mozilla.com>
Tue, 16 Jun 2020 14:27:43 +0000
changeset 599950 94c5fe1a7033d03b4849aef058df1dea3f40d417
parent 599949 ae31f01f26586590b30183c1b42fa74505121072
child 599951 640d29fc859077ce616f6cf15f1a87ff5a095e30
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1641796
milestone79.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 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
devtools/client/debugger/test/mochitest/browser.ini
devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.js
--- a/devtools/client/debugger/test/mochitest/browser.ini
+++ b/devtools/client/debugger/test/mochitest/browser.ini
@@ -181,16 +181,18 @@ skip-if = os == "win"
 [browser_dbg-toggling-tools.js]
 [browser_dbg-react-app.js]
 skip-if = os == "win"
 [browser_dbg-wasm-sourcemaps.js]
 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]
 skip-if = (os == 'linux' && debug) || (os == 'linux' && asan) || ccov  #Bug 1456013, Bug 1559547
 [browser_dbg-event-handler.js]
 [browser_dbg-event-breakpoints.js]
 [browser_dbg-eval-throw.js]
 [browser_dbg-sourceURL-breakpoint.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-windowless-service-workers-reload.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);
+});