blob: 1984ad97961f5640ace49f9c9d9f8fa68d6a2dfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/* 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.
"use strict";
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);
});
|