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-paused-overlay-loading.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-paused-overlay-loading.js')
-rw-r--r-- | devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js b/devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js new file mode 100644 index 0000000000..c869eb7f6f --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js @@ -0,0 +1,45 @@ +/* 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/>. */ + +// Tests that the paused overlay isn't visible after resuming if the debugger paused +// while the DOM was still loading (Bug 1678636). + +"use strict"; + +add_task(async function() { + const dbg = await initDebuggerWithAbsoluteURL( + "data:text/html,<meta charset=utf8><script>debugger;</script>" + ); + + info("Reload the page to hit the debugger statement while loading"); + reload(dbg); + await waitForPaused(dbg); + ok(true, "We're paused"); + + info("Check that the paused overlay is displayed"); + const highlighterTestFront = await dbg.toolbox.target.getFront( + "highlighterTest" + ); + + await waitFor(async () => { + const visible = await highlighterTestFront.isPausedDebuggerOverlayVisible(); + return visible; + }); + ok(true, "Paused debugger overlay is visible"); + + info("Click the resume button"); + await highlighterTestFront.clickPausedDebuggerOverlayButton( + "paused-dbg-resume-button" + ); + + await waitForResumed(dbg); + ok("The debugger isn't paused after clicking on the resume button"); + + await waitFor(async () => { + const visible = await highlighterTestFront.isPausedDebuggerOverlayVisible(); + return !visible; + }); + + ok(true, "The overlay is now hidden"); +}); |