tor-browser

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

browser_history_after_appMenu.js (1349B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /**
      7 * Checks that opening the History view using the default toolbar button works
      8 * also while the view is displayed in the main menu.
      9 */
     10 add_task(async function test_history_after_appMenu() {
     11  // First add the button to the toolbar and wait for it to show up:
     12  CustomizableUI.addWidgetToArea("history-panelmenu", "nav-bar");
     13  registerCleanupFunction(() =>
     14    CustomizableUI.removeWidgetFromArea("history-panelmenu")
     15  );
     16  await waitForElementShown(document.getElementById("history-panelmenu"));
     17 
     18  let historyView = PanelMultiView.getViewNode(document, "PanelUI-history");
     19  // Open the main menu.
     20  await gCUITestUtils.openMainMenu();
     21 
     22  // Show the History view as a subview of the main menu.
     23  document.getElementById("appMenu-history-button").click();
     24  await BrowserTestUtils.waitForEvent(historyView, "ViewShown");
     25 
     26  // Show the History view as the main view of the History panel.
     27  document.getElementById("history-panelmenu").click();
     28  await BrowserTestUtils.waitForEvent(historyView, "ViewShown");
     29 
     30  // Close the history panel.
     31  let historyPanel = historyView.closest("panel");
     32  let promise = BrowserTestUtils.waitForEvent(historyPanel, "popuphidden");
     33  historyPanel.hidePopup();
     34  await promise;
     35 });