tor-browser

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

browser_inspector_destroy-before-ready.js (921B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test that switching to the inspector panel and not waiting for it to be fully
      7 // loaded doesn't fail the test with unhandled rejected promises.
      8 
      9 add_task(async function () {
     10  // At least one assertion is needed to avoid failing the test, but really,
     11  // what we're interested in is just having the test pass when switching to the
     12  // inspector.
     13  ok(true);
     14 
     15  await addTab("data:text/html;charset=utf-8,test inspector destroy");
     16 
     17  info("Open the toolbox on the debugger panel");
     18  const toolbox = await gDevTools.showToolboxForTab(gBrowser.selectedTab, {
     19    toolId: "jsdebugger",
     20  });
     21 
     22  info("Switch to the inspector panel and immediately end the test");
     23  const onInspectorSelected = toolbox.once("inspector-selected");
     24  toolbox.selectTool("inspector");
     25  await onInspectorSelected;
     26 });