From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../mochitest/browser_dbg-blackbox-original.js | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-blackbox-original.js') 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..c1bf46da7f --- /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 . */ + +// This source map does not have source contents, so it's fetched separately + +"use strict"; + +add_task(async function () { + // NOTE: the CORS call makes the test run times inconsistent + const dbg = await initDebugger( + "doc-sourcemaps3.html", + "bundle.js", + "sorted.js", + "test.js" + ); + dbg.actions.toggleMapScopes(); + + 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"); +}); -- cgit v1.2.3