tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_dbg-paused-overlay-loading.js (1497B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
      4 
      5 // Tests that the paused overlay isn't visible after resuming if the debugger paused
      6 // while the DOM was still loading (Bug 1678636).
      7 
      8 "use strict";
      9 
     10 add_task(async function () {
     11  const dbg = await initDebuggerWithAbsoluteURL(
     12    "data:text/html,<meta charset=utf8><script>debugger;</script>"
     13  );
     14 
     15  info("Reload the page to hit the debugger statement while loading");
     16  const onReloaded = reload(dbg);
     17  await waitForPaused(dbg);
     18  ok(true, "We're paused");
     19 
     20  info("Check that the paused overlay is displayed");
     21  const highlighterTestFront =
     22    await dbg.toolbox.target.getFront("highlighterTest");
     23 
     24  await waitFor(async () => {
     25    const visible = await highlighterTestFront.isPausedDebuggerOverlayVisible();
     26    return visible;
     27  });
     28  ok(true, "Paused debugger overlay is visible");
     29 
     30  info("Click the resume button");
     31  await highlighterTestFront.clickPausedDebuggerOverlayButton(
     32    "paused-dbg-resume-button"
     33  );
     34 
     35  await waitForResumed(dbg);
     36  ok("The debugger isn't paused after clicking on the resume button");
     37 
     38  await waitFor(async () => {
     39    const visible = await highlighterTestFront.isPausedDebuggerOverlayVisible();
     40    return !visible;
     41  });
     42 
     43  ok(true, "The overlay is now hidden");
     44 
     45  info("Wait for reload to complete after resume");
     46  await onReloaded;
     47 });