summaryrefslogtreecommitdiffstats
path: root/browser/components/uitour/test/browser_showMenu.js
blob: 8aa8f7cd790fbe07b5cb1ce7372cc7d80ea7f70a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"use strict";

const { UrlbarTestUtils } = ChromeUtils.import(
  "resource://testing-common/UrlbarTestUtils.jsm"
);

var gTestTab;
var gContentAPI;
var gContentWindow;

add_task(setup_UITourTest);

add_UITour_task(async function test_showMenu_hideMenu_pageActionPanel() {
  let pageActionPanel = BrowserPageActions.panelNode;
  let shownPromise = promisePanelElementShown(window, pageActionPanel);
  await showMenuPromise("pageActionPanel");
  await shownPromise;
  is(
    pageActionPanel.state,
    "open",
    "The page action panel should open after showMenu"
  );
  let hidePromise = promisePanelElementHidden(window, pageActionPanel);
  await gContentAPI.hideMenu("pageActionPanel");
  await hidePromise;
  is(
    pageActionPanel.state,
    "closed",
    "The page action panel should close after hideMenu"
  );
});