tor-browser

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

browser_inspector_destroy-after-navigation.js (636B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 // Testing that closing the inspector after navigating to a page doesn't fail.
      6 
      7 const URL_1 = "data:text/plain;charset=UTF-8,abcde";
      8 const URL_2 = "data:text/plain;charset=UTF-8,12345";
      9 
     10 add_task(async function () {
     11  const { toolbox } = await openInspectorForURL(URL_1);
     12 
     13  await navigateTo(URL_2);
     14 
     15  info("Destroying toolbox");
     16  try {
     17    await toolbox.destroy();
     18    ok(true, "Toolbox destroyed");
     19  } catch (e) {
     20    ok(false, "An exception occured while destroying toolbox");
     21    console.error(e);
     22  }
     23 });