diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /devtools/client/debugger/test/mochitest/browser_dbg-debug-line.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-debug-line.js')
-rw-r--r-- | devtools/client/debugger/test/mochitest/browser_dbg-debug-line.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-debug-line.js b/devtools/client/debugger/test/mochitest/browser_dbg-debug-line.js new file mode 100644 index 0000000000..769f8ad9c0 --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg-debug-line.js @@ -0,0 +1,46 @@ +/* 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 ensures zombie debug lines do not persist +// https://github.com/firefox-devtools/debugger/issues/7755 + +"use strict"; + +add_task(async function() { + // Load test files + const dbg = await initDebugger("doc-sources.html"); + await waitForSources(dbg, "simple1.js", "simple2.js"); + + // Add breakpoint to debug-line-2 + await selectSource(dbg, "simple2.js"); + await addBreakpoint(dbg, "simple2.js", 5); + + // Trigger the breakpoint ane ensure we're paused + invokeInTab("main"); + await waitForPaused(dbg); + await waitForDispatch(dbg.store, "ADD_INLINE_PREVIEW"); + + // Scroll element into view + findElement(dbg, "frame", 2).focus(); + + // Click the call stack to get to debugger-line-1 + const dispatched = waitForDispatch(dbg.store, "ADD_INLINE_PREVIEW"); + await clickElement(dbg, "frame", 2); + await dispatched; + await waitForRequestsToSettle(dbg); + await waitForSelectedSource(dbg, "simple1.js"); + + // Resume, which ends all pausing and would trigger the problem + await resume(dbg); + + // Select the source that had the initial debug line + await selectSource(dbg, "simple2.js"); + + info("Ensuring there's no zombie debug line"); + is( + findAllElements(dbg, "debugLine").length, + 0, + "Debug line no longer exists!" + ); +}); |