From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../browser_dbg-paused-overlay-loading.js | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js (limited to 'devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js') 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..0601a66a9c --- /dev/null +++ b/devtools/client/debugger/test/mochitest/browser_dbg-paused-overlay-loading.js @@ -0,0 +1,48 @@ +/* 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 . */ + +// 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," + ); + + info("Reload the page to hit the debugger statement while loading"); + const onReloaded = 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"); + + info("Wait for reload to complete after resume"); + await onReloaded; +}); -- cgit v1.2.3