summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js')
-rw-r--r--devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js b/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js
new file mode 100644
index 0000000000..b9e06e4121
--- /dev/null
+++ b/devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js
@@ -0,0 +1,53 @@
+/* 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/>. */
+
+// This source map does not have source contents, so it's fetched separately
+
+"use strict";
+
+add_task(async function () {
+ await pushPref("devtools.debugger.map-scopes-enabled", true);
+ // NOTE: the CORS call makes the test run times inconsistent
+ const dbg = await initDebugger(
+ "doc-sourcemaps3.html",
+ "bundle.js",
+ "sorted.js",
+ "test.js"
+ );
+
+ const sortedSrc = findSource(dbg, "sorted.js");
+ await selectSource(dbg, sortedSrc);
+ await clickElement(dbg, "blackbox");
+ await waitForDispatch(dbg.store, "BLACKBOX_WHOLE_SOURCES");
+
+ const sourceTab = findElementWithSelector(dbg, ".source-tab.active");
+ ok(
+ sourceTab.querySelector(".img.blackBox"),
+ "Source tab has a blackbox icon"
+ );
+
+ const treeItem = findElementWithSelector(dbg, ".tree-node.focused");
+ ok(
+ treeItem.querySelector(".img.blackBox"),
+ "Source tree item has a blackbox icon"
+ );
+
+ // breakpoint at line 38 in sorted
+ await addBreakpoint(dbg, sortedSrc, 38);
+ // invoke test
+ invokeInTab("test");
+ // should not pause
+ assertNotPaused(dbg);
+
+ // unblackbox
+ await clickElement(dbg, "blackbox");
+ await waitForDispatch(dbg.store, "UNBLACKBOX_WHOLE_SOURCES");
+
+ // click on test
+ invokeInTab("test");
+ // should pause
+ await waitForPaused(dbg);
+
+ ok(true, "blackbox works");
+});