tor-browser

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

browser_UITour_pocket.js (977B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 var gTestTab;
      7 var gContentAPI;
      8 
      9 add_task(setup_UITourTest);
     10 
     11 add_UITour_task(async function test_menu_show() {
     12  let panel = BrowserPageActions.activatedActionPanelNode;
     13  Assert.ok(
     14    !panel || panel.state == "closed",
     15    "Pocket panel should initially be closed"
     16  );
     17  gContentAPI.showMenu("pocket");
     18 
     19  // The panel gets created dynamically.
     20  panel = null;
     21  await waitForConditionPromise(() => {
     22    panel = BrowserPageActions.activatedActionPanelNode;
     23    return panel && panel.state == "open";
     24  }, "Menu should be visible after showMenu()");
     25 
     26  Assert.ok(
     27    !panel.hasAttribute("noautohide"),
     28    "@noautohide shouldn't be on the pocket panel"
     29  );
     30 
     31  panel.hidePopup();
     32  await new Promise(resolve => {
     33    panel = BrowserPageActions.activatedActionPanelNode;
     34    if (!panel || panel.state == "closed") {
     35      resolve();
     36    }
     37  });
     38 });