tor-browser

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

browser_inspector_addNode_01.js (748B)


      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 the add node button and context menu items are present in the UI.
      7 
      8 const TEST_URL = "data:text/html;charset=utf-8,<h1>Add node</h1>";
      9 
     10 add_task(async function () {
     11  const { inspector } = await openInspectorForURL(TEST_URL);
     12  const { panelDoc } = inspector;
     13 
     14  const allMenuItems = openContextMenuAndGetAllItems(inspector);
     15  const menuItem = allMenuItems.find(item => item.id === "node-menu-add");
     16  ok(menuItem, "The item is in the menu");
     17 
     18  const toolbarButton = panelDoc.querySelector(
     19    "#inspector-toolbar #inspector-element-add-button"
     20  );
     21  ok(toolbarButton, "The add button is in the toolbar");
     22 });