Bug 1382579 - Part 3: Tests, r=gijs draft
authorFischer Liu<fliu@mozilla.com>
Wed, 02 Aug 2017 13:53:05 +0800
changeset 642383 cc41e38fe53300e988570b9187d104bf5c9fa76d
parent 642382 bc774e747c84e9a26f73ab5c0bfaddade47b956d
child 724968 b4d49d33c9ca2b9481c736ef84ad57697ec0274b
push id72719
push userfliu@mozilla.com
push dateTue, 08 Aug 2017 03:33:37 +0000
reviewersgijs
bugs1382579
milestone57.0a1
Bug 1382579 - Part 3: Tests, r=gijs This commit - adds 2 utility functions to the uitour's head.js - adds the browser_UITour4.js - moves the tests in the browser_showMenu_controlCenter.js into the newly added the browser_showMenu.js - deletes the browser_showMenu_urlbar.js because it's test has been modified and moved into the browser_showMenu.js - adds one test case for the page action panel in the browser_showMenu.js - updates the browser_UITour_availableTargets.js test because we have more targets right now. MozReview-Commit-ID: CydEAkqAl3V
browser/components/uitour/test/browser.ini
browser/components/uitour/test/browser_UITour4.js
browser/components/uitour/test/browser_UITour_availableTargets.js
browser/components/uitour/test/browser_showMenu.js
browser/components/uitour/test/browser_showMenu_controlCenter.js
browser/components/uitour/test/browser_showMenu_urlbar.js
browser/components/uitour/test/head.js
--- a/browser/components/uitour/test/browser.ini
+++ b/browser/components/uitour/test/browser.ini
@@ -16,23 +16,23 @@ skip-if = true # Bug 1113038 - Intermitt
 [browser_trackingProtection.js]
 skip-if = os == "linux" # Intermittent NS_ERROR_NOT_AVAILABLE [nsIUrlClassifierDBService.beginUpdate]
 tag = trackingprotection
 support-files =
   !/browser/base/content/test/general/benignPage.html
   !/browser/base/content/test/general/trackingPage.html
 [browser_trackingProtection_tour.js]
 tag = trackingprotection
-[browser_showMenu_controlCenter.js]
-[browser_showMenu_urlbar.js]
+[browser_showMenu.js]
 tag = trackingprotection
 [browser_UITour.js]
 skip-if = os == "linux" # Intermittent failures, bug 951965
 [browser_UITour2.js]
 [browser_UITour3.js]
+[browser_UITour4.js]
 skip-if = os == "linux" # Linux: Bug 986760, Bug 989101.
 [browser_UITour_availableTargets.js]
 [browser_UITour_annotation_size_attributes.js]
 [browser_UITour_defaultBrowser.js]
 [browser_UITour_detach_tab.js]
 [browser_UITour_forceReaderMode.js]
 [browser_UITour_modalDialog.js]
 skip-if = os != "mac" # modal dialog disabling only working on OS X.
new file mode 100644
--- /dev/null
+++ b/browser/components/uitour/test/browser_UITour4.js
@@ -0,0 +1,285 @@
+"use strict";
+
+var gTestTab;
+var gContentAPI;
+var gContentWindow;
+
+add_task(setup_UITourTest);
+
+add_UITour_task(async function test_highligh_between_pageActionButtonOnUrlbar_and_buttonOnPageActionPanel() {
+  let highlight = document.getElementById("UITourHighlight");
+  is_element_hidden(highlight, "Highlight should initially be hidden");
+
+  // Test highlighting the page action button on the urlbar
+  let pageActionPanel = BrowserPageActions.panelNode;
+  let highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
+  gContentAPI.showHighlight("pageActionButton");
+  await highlightVisiblePromise;
+  is(pageActionPanel.state, "closed", "Shouldn't open the page action panel while highlighting the pageActionButton");
+  is(getShowHighlightTargetName(), "pageActionButton", "Should highlight the pageActionButton");
+
+  // Test switching the highlight to the bookmark button on the page action panel
+  let panelShownPromise = promisePanelElementShown(window, pageActionPanel);
+  highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
+  gContentAPI.showHighlight("pageAction-panel-bookmark");
+  await highlightVisiblePromise;
+  await panelShownPromise;
+  is(pageActionPanel.state, "open", "Should open the page action panel for highlighting the pageAction-panel-bookmark");
+  is(getShowHighlightTargetName(), "pageAction-panel-bookmark", "Should highlight the pageAction-panel-bookmark");
+
+  // Test hiding highlight
+  let panelHiddenPromise = promisePanelElementHidden(window, pageActionPanel);
+  let highlightHiddenPromise = elementHiddenPromise(highlight, "Should hide highlight");
+  gContentAPI.hideHighlight();
+  await highlightHiddenPromise;
+  await panelHiddenPromise;
+  is(pageActionPanel.state, "closed", "Should close the page action panel after hiding highlight");
+});
+
+add_UITour_task(async function test_highligh_between_buttonOnAppMenu_and_buttonOnPageActionPanel() {
+  let highlight = document.getElementById("UITourHighlight");
+  is_element_hidden(highlight, "Highlight should initially be hidden");
+
+  let appMenu = window.PanelUI.panel;
+  let pageActionPanel = BrowserPageActions.panelNode;
+
+  // Test highlighting the addons button on the app menu
+  let appMenuShownPromise = promisePanelElementShown(window, appMenu);
+  let highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
+  gContentAPI.showHighlight("addons");
+  await appMenuShownPromise;
+  await highlightVisiblePromise;
+  is(appMenu.state, "open", "Should open the app menu to highlight the addons button");
+  is(pageActionPanel.state, "closed", "Shouldn't open the page action panel");
+  is(getShowHighlightTargetName(), "addons", "Should highlight the addons button on the app menu");
+
+  // Test switching the highlight to the copyURL button on the page action panel
+  let appMenuHiddenPromise = promisePanelElementHidden(window, appMenu);
+  let pageActionPanelShownPromise = promisePanelElementShown(window, pageActionPanel);
+  highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
+  gContentAPI.showHighlight("pageAction-panel-copyURL");
+  await appMenuHiddenPromise;
+  await pageActionPanelShownPromise;
+  await highlightVisiblePromise;
+  is(appMenu.state, "closed", "Should close the app menu after no more highlight for the addons button");
+  is(pageActionPanel.state, "open", "Should open the page action panel to highlight the copyURL button");
+  is(getShowHighlightTargetName(), "pageAction-panel-copyURL", "Should highlight the copyURL button on the page action panel");
+
+  // Test hiding highlight
+  let pageActionPanelHiddenPromise = promisePanelElementHidden(window, pageActionPanel);
+  let highlightHiddenPromise = elementHiddenPromise(highlight, "Should hide highlight");
+  gContentAPI.hideHighlight();
+  await pageActionPanelHiddenPromise
+  await highlightHiddenPromise;
+  is(appMenu.state, "closed", "Shouldn't open the app menu after hiding highlight");
+  is(pageActionPanel.state, "closed", "Should close the page action panel after hiding highlight");
+});
+
+add_UITour_task(async function test_showInfo_between_buttonOnPageActionPanel_and_buttonOnAppMenu() {
+  let tooltip = document.getElementById("UITourTooltip");
+  is_element_hidden(tooltip, "Tooltip should initially be hidden");
+
+  let appMenu = window.PanelUI.panel;
+  let pageActionPanel = BrowserPageActions.panelNode;
+
+  // Test showing info tooltip on the emailLink button on the page action panel
+  let pageActionPanelShownPromise = promisePanelElementShown(window, pageActionPanel);
+  let tooltipVisiblePromise = elementVisiblePromise(tooltip, "Should show info tooltip");
+  await showInfoPromise("pageAction-panel-emailLink", "title", "text");
+  await pageActionPanelShownPromise;
+  await tooltipVisiblePromise;
+  is(appMenu.state, "closed", "Shouldn't open the app menu");
+  is(pageActionPanel.state, "open", "Should open the page action panel to show info on the copyURL button");
+  is(getShowInfoTargetName(), "pageAction-panel-emailLink", "Should show info tooltip on the emailLink button on the page action panel");
+
+  // Test switching info tooltip to the customize button on the app menu
+  let appMenuShownPromise = promisePanelElementShown(window, appMenu);
+  let pageActionPanelHiddenPromise = promisePanelElementHidden(window, pageActionPanel);
+  tooltipVisiblePromise = elementVisiblePromise(tooltip, "Should show info tooltip");
+  await showInfoPromise("customize", "title", "text");
+  await appMenuShownPromise;
+  await pageActionPanelHiddenPromise;
+  await tooltipVisiblePromise;
+  is(appMenu.state, "open", "Should open the app menu to show info on the customize button");
+  is(pageActionPanel.state, "closed", "Should close the page action panel after no more show info for the copyURL button");
+  is(getShowInfoTargetName(), "customize", "Should show info tooltip on the customize button on the app menu");
+
+  // Test hiding info tooltip
+  let appMenuHiddenPromise = promisePanelElementHidden(window, appMenu);
+  let tooltipHiddenPromise = elementHiddenPromise(tooltip, "Should hide info");
+  gContentAPI.hideInfo();
+  await appMenuHiddenPromise;
+  await tooltipHiddenPromise;
+  is(appMenu.state, "closed", "Should close the app menu after hiding info");
+  is(pageActionPanel.state, "closed", "Shouldn't open the page action panel after hiding info");
+});
+
+add_UITour_task(async function test_highlight_buttonOnPageActionPanel_and_showInfo_buttonOnAppMenu() {
+  let highlight = document.getElementById("UITourHighlight");
+  is_element_hidden(highlight, "Highlight should initially be hidden");
+  let tooltip = document.getElementById("UITourTooltip");
+  is_element_hidden(tooltip, "Tooltip should initially be hidden");
+
+  let appMenu = window.PanelUI.panel;
+  let pageActionPanel = BrowserPageActions.panelNode;
+
+  // Test highlighting the sendToDevice button on the page action panel
+  let pageActionPanelShownPromise = promisePanelElementShown(window, pageActionPanel);
+  let highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
+  gContentAPI.showHighlight("pageAction-panel-sendToDevice");
+  await pageActionPanelShownPromise;
+  await highlightVisiblePromise;
+  is(appMenu.state, "closed", "Shouldn't open the app menu");
+  is(pageActionPanel.state, "open", "Should open the page action panel to highlight the sendToDevice button");
+  is(getShowHighlightTargetName(), "pageAction-panel-sendToDevice", "Should highlight the sendToDevice button on the page action panel");
+
+  // Test showing info tooltip on the privateWindow button on the app menu
+  let appMenuShownPromise = promisePanelElementShown(window, appMenu);
+  let tooltipVisiblePromise = elementVisiblePromise(tooltip, "Should show info tooltip");
+  let pageActionPanelHiddenPromise = promisePanelElementHidden(window, pageActionPanel);
+  let highlightHiddenPromise = elementHiddenPromise(highlight, "Should hide highlight");
+  await showInfoPromise("privateWindow", "title", "text");
+  await appMenuShownPromise;
+  await tooltipVisiblePromise;
+  await pageActionPanelHiddenPromise;
+  await highlightHiddenPromise;
+  is(appMenu.state, "open", "Should open the app menu to show info on the privateWindow button");
+  is(pageActionPanel.state, "closed", "Should close the page action panel");
+  is(getShowInfoTargetName(), "privateWindow", "Should show info tooltip on the privateWindow button on the app menu");
+
+  // Test hiding info tooltip
+  let appMenuHiddenPromise = promisePanelElementHidden(window, appMenu);
+  let tooltipHiddenPromise = elementHiddenPromise(tooltip, "Should hide info");
+  gContentAPI.hideInfo();
+  await appMenuHiddenPromise;
+  await tooltipHiddenPromise;
+  is(appMenu.state, "closed", "Should close the app menu after hiding info tooltip");
+});
+
+add_UITour_task(async function test_showInfo_buttonOnAppMenu_and_highlight_buttonOnPageActionPanel() {
+  let highlight = document.getElementById("UITourHighlight");
+  is_element_hidden(highlight, "Highlight should initially be hidden");
+  let tooltip = document.getElementById("UITourTooltip");
+  is_element_hidden(tooltip, "Tooltip should initially be hidden");
+
+  let appMenu = window.PanelUI.panel;
+  let pageActionPanel = BrowserPageActions.panelNode;
+
+  // Test showing info tooltip on the privateWindow button on the app menu
+  let appMenuShownPromise = promisePanelElementShown(window, appMenu);
+  let tooltipVisiblePromise = elementVisiblePromise(tooltip, "Should show info tooltip");
+  await showInfoPromise("privateWindow", "title", "text");
+  await appMenuShownPromise;
+  await tooltipVisiblePromise;
+  is(appMenu.state, "open", "Should open the app menu to show info on the privateWindow button");
+  is(pageActionPanel.state, "closed", "Shouldn't open the page action panel");
+  is(getShowInfoTargetName(), "privateWindow", "Should show info tooltip on the privateWindow button on the app menu");
+
+  // Test highlighting the sendToDevice button on the page action panel
+  let pageActionPanelShownPromise = promisePanelElementShown(window, pageActionPanel);
+  let highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
+  let appMenuHiddenPromise = promisePanelElementHidden(window, appMenu);
+  let tooltipHiddenPromise = elementHiddenPromise(tooltip, "Should hide info");
+  gContentAPI.showHighlight("pageAction-panel-sendToDevice");
+  await pageActionPanelShownPromise;
+  await highlightVisiblePromise;
+  await appMenuHiddenPromise;
+  await tooltipHiddenPromise;
+  is(appMenu.state, "closed", "Should close the app menu");
+  is(pageActionPanel.state, "open", "Should open the page action panel to highlight the sendToDevice button");
+  is(getShowHighlightTargetName(), "pageAction-panel-sendToDevice", "Should highlight the sendToDevice button on the page action panel");
+
+  // Test hiding highlight
+  let pageActionPanelHiddenPromise = promisePanelElementHidden(window, pageActionPanel);
+  let highlightHiddenPromise = elementHiddenPromise(highlight, "Should hide highlight");
+  gContentAPI.hideHighlight();
+  await pageActionPanelHiddenPromise;
+  await highlightHiddenPromise;
+  is(pageActionPanel.state, "closed", "Should close the page action panel after hiding highlight");
+});
+
+add_UITour_task(async function test_show_appMenu_and_highligh_buttonOnPageActionPanel() {
+  let highlight = document.getElementById("UITourHighlight");
+  is_element_hidden(highlight, "Highlight should initially be hidden");
+
+  let appMenu = window.PanelUI.panel;
+  let pageActionPanel = BrowserPageActions.panelNode;
+
+  // Test explicity asking for opening the app menu
+  let appMenuShownPromise = promisePanelElementShown(window, appMenu);
+  gContentAPI.showMenu("appMenu");
+  await appMenuShownPromise;
+  is(appMenu.state, "open", "Should open the app menu");
+  is(pageActionPanel.state, "closed", "Shouldn't open the page action panel");
+
+  // Test highlighting the sendToDevice button on the page action panel
+  let pageActionPanelShownPromise = promisePanelElementShown(window, pageActionPanel);
+  let highlightVisiblePromise = elementVisiblePromise(highlight, "Should show highlight");
+  gContentAPI.showHighlight("pageAction-panel-sendToDevice");
+  await pageActionPanelShownPromise;
+  await highlightVisiblePromise;
+  is(appMenu.state, "open", "Shouldn't close the app menu because it is opened explictly by api user.");
+  is(pageActionPanel.state, "open", "Should open the page action panel to highlight the sendToDevice button");
+  is(getShowHighlightTargetName(), "pageAction-panel-sendToDevice", "Should highlight the sendToDevice button on the page action panel");
+
+  // Test hiding the app menu wouldn't affect the highlight on the page action panel
+  let appMenuHiddenPromise = promisePanelElementHidden(window, appMenu);
+  gContentAPI.hideMenu("appMenu");
+  await appMenuHiddenPromise;
+  is_element_visible(highlight, "Highlight should still be visible");
+  is(appMenu.state, "closed", "Should close the app menu");
+  is(pageActionPanel.state, "open", "Shouldn't close the page action panel");
+  is(getShowHighlightTargetName(), "pageAction-panel-sendToDevice", "Should still highlight the sendToDevice button on the page action panel");
+
+  // Test hiding highlight
+  let pageActionPanelHiddenPromise = promisePanelElementHidden(window, pageActionPanel);
+  let highlightHiddenPromise = elementHiddenPromise(highlight, "Should hide highlight");
+  gContentAPI.hideHighlight();
+  await pageActionPanelHiddenPromise;
+  await highlightHiddenPromise;
+  is(appMenu.state, "closed", "Shouldn't open the app menu");
+  is(pageActionPanel.state, "closed", "Should close the page action panel after hiding highlight");
+});
+
+add_UITour_task(async function test_show_pageActionPanel_and_showInfo_buttonOnAppMenu() {
+  let tooltip = document.getElementById("UITourTooltip");
+  is_element_hidden(tooltip, "Tooltip should initially be hidden");
+
+  let appMenu = window.PanelUI.panel;
+  let pageActionPanel = BrowserPageActions.panelNode;
+
+  // Test explicity asking for opening the page action panel
+  let pageActionPanelShownPromise = promisePanelElementShown(window, pageActionPanel);
+  gContentAPI.showMenu("pageActionPanel");
+  await pageActionPanelShownPromise;
+  is(appMenu.state, "closed", "Shouldn't open the app menu");
+  is(pageActionPanel.state, "open", "Should open the page action panel");
+
+  // Test showing info tooltip on the privateWindow button on the app menu
+  let appMenuShownPromise = promisePanelElementShown(window, appMenu);
+  let tooltipVisiblePromise = elementVisiblePromise(tooltip, "Should show info tooltip");
+  await showInfoPromise("privateWindow", "title", "text");
+  await appMenuShownPromise;
+  await tooltipVisiblePromise;
+  is(appMenu.state, "open", "Should open the app menu to show info on the privateWindow button");
+  is(pageActionPanel.state, "open", "Shouldn't close the page action panel because it is opened explictly by api user.");
+  is(getShowInfoTargetName(), "privateWindow", "Should show info tooltip on the privateWindow button on the app menu");
+
+  // Test hiding the page action panel wouldn't affect the info tooltip on the app menu
+  let pageActionPanelHiddenPromise = promisePanelElementHidden(window, pageActionPanel);
+  gContentAPI.hideMenu("pageActionPanel");
+  await pageActionPanelHiddenPromise;
+  is_element_visible(tooltip, "Tooltip should still be visible");
+  is(appMenu.state, "open", "Shouldn't close the app menu");
+  is(pageActionPanel.state, "closed", "Should close the page action panel after hideMenu");
+  is(getShowInfoTargetName(), "privateWindow", "Should still show info tooltip on the privateWindow button on the app menu");
+
+  // Test hiding info tooltip
+  let appMenuHiddenPromise = promisePanelElementHidden(window, appMenu);
+  let tooltipHiddenPromise = elementHiddenPromise(tooltip, "Should hide info");
+  gContentAPI.hideInfo();
+  await appMenuHiddenPromise;
+  await tooltipHiddenPromise;
+  is(appMenu.state, "closed", "Should close the app menu after hideInfo");
+  is(pageActionPanel.state, "closed", "Shouldn't open the page action panel");
+});
--- a/browser/components/uitour/test/browser_UITour_availableTargets.js
+++ b/browser/components/uitour/test/browser_UITour_availableTargets.js
@@ -3,101 +3,82 @@
 var gTestTab;
 var gContentAPI;
 var gContentWindow;
 
 var hasPocket = Services.prefs.getBoolPref("extensions.pocket.enabled");
 var hasQuit = AppConstants.platform != "macosx";
 
 requestLongerTimeout(2);
-add_task(setup_UITourTest);
 
-add_UITour_task(async function test_availableTargets() {
-  let data = await getConfigurationPromise("availableTargets");
-  ok_targets(data, [
+function getExpectedTargets() {
+  return [
     "accountStatus",
     "addons",
     "appMenu",
     "backForward",
     "bookmarks",
+    "bookmark-star-button",
     "customize",
     "devtools",
     "help",
     "home",
     "library",
+    "pageActionButton",
+    "pageAction-panel-bookmark",
+    "pageAction-panel-copyURL",
+    "pageAction-panel-emailLink",
+    "pageAction-panel-sendToDevice",
       ...(hasPocket ? ["pocket"] : []),
     "privateWindow",
       ...(hasQuit ? ["quit"] : []),
     "readerMode-urlBar",
     "search",
     "searchIcon",
     "trackingProtection",
     "urlbar",
-  ]);
+  ];
+}
+
+add_task(setup_UITourTest);
+
+add_UITour_task(async function test_availableTargets() {
+  let data = await getConfigurationPromise("availableTargets");
+  let expecteds = getExpectedTargets();
+  ok_targets(data, expecteds);
 
   ok(UITour.availableTargetsCache.has(window),
      "Targets should now be cached");
 });
 
 add_UITour_task(async function test_availableTargets_changeWidgets() {
   CustomizableUI.removeWidgetFromArea("bookmarks-menu-button");
   ok(!UITour.availableTargetsCache.has(window),
      "Targets should be evicted from cache after widget change");
   let data = await getConfigurationPromise("availableTargets");
-  ok_targets(data, [
-    "accountStatus",
-    "addons",
-    "appMenu",
-    "backForward",
-    "customize",
-    "help",
-    "devtools",
-    "home",
-    "library",
-      ...(hasPocket ? ["pocket"] : []),
-    "privateWindow",
-      ...(hasQuit ? ["quit"] : []),
-    "readerMode-urlBar",
-    "search",
-    "searchIcon",
-    "trackingProtection",
-    "urlbar",
-  ]);
+  let expecteds = getExpectedTargets();
+  expecteds = expecteds.filter(target => target != "bookmarks");
+  ok_targets(data, expecteds);
 
   ok(UITour.availableTargetsCache.has(window),
      "Targets should now be cached again");
   CustomizableUI.reset();
   ok(!UITour.availableTargetsCache.has(window),
      "Targets should not be cached after reset");
 });
 
 add_UITour_task(async function test_availableTargets_exceptionFromGetTarget() {
   // The query function for the "search" target will throw if it's not found.
   // Make sure the callback still fires with the other available targets.
   CustomizableUI.removeWidgetFromArea("search-container");
   let data = await getConfigurationPromise("availableTargets");
+  let expecteds = getExpectedTargets();
   // Default minus "search" and "searchIcon"
-  ok_targets(data, [
-    "accountStatus",
-    "addons",
-    "appMenu",
-    "backForward",
-    "bookmarks",
-    "customize",
-    "devtools",
-    "help",
-    "home",
-    "library",
-      ...(hasPocket ? ["pocket"] : []),
-    "privateWindow",
-      ...(hasQuit ? ["quit"] : []),
-    "readerMode-urlBar",
-    "trackingProtection",
-    "urlbar",
-  ]);
+  expecteds = expecteds.filter(target => target != "search" && target != "searchIcon");
+  ok_targets(data, expecteds);
 
   CustomizableUI.reset();
 });
 
 function ok_targets(actualData, expectedTargets) {
   // Depending on how soon after page load this is called, the selected tab icon
   // may or may not be showing the loading throbber.  Check for its presence and
   // insert it into expectedTargets if it's visible.
rename from browser/components/uitour/test/browser_showMenu_controlCenter.js
rename to browser/components/uitour/test/browser_showMenu.js
--- a/browser/components/uitour/test/browser_showMenu_controlCenter.js
+++ b/browser/components/uitour/test/browser_showMenu.js
@@ -5,17 +5,17 @@ const CONTROL_CENTER_PANEL = gIdentityHa
 const CONTROL_CENTER_MENU_NAME = "controlCenter";
 
 var gTestTab;
 var gContentAPI;
 var gContentWindow;
 
 add_task(setup_UITourTest);
 
-add_UITour_task(async function test_showMenu() {
+add_UITour_task(async function test_showMenu_controlCenter() {
   is_element_hidden(CONTROL_CENTER_PANEL, "Panel should initially be hidden");
   await showMenuPromise(CONTROL_CENTER_MENU_NAME);
   is_element_visible(CONTROL_CENTER_PANEL, "Panel should be visible after showMenu");
 
   await gURLBar.focus();
   is_element_visible(CONTROL_CENTER_PANEL, "Panel should remain visible after focus outside");
 
   await showMenuPromise(CONTROL_CENTER_MENU_NAME);
@@ -27,18 +27,42 @@ add_UITour_task(async function test_show
     url: "about:blank"
   }, function() {
     ok(true, "Tab opened");
   });
 
   is_element_hidden(CONTROL_CENTER_PANEL, "Panel should hide upon tab switch");
 });
 
-add_UITour_task(async function test_hideMenu() {
+add_UITour_task(async function test_hideMenu_controlCenter() {
   is_element_hidden(CONTROL_CENTER_PANEL, "Panel should initially be hidden");
   await showMenuPromise(CONTROL_CENTER_MENU_NAME);
   is_element_visible(CONTROL_CENTER_PANEL, "Panel should be visible after showMenu");
   let hidePromise = promisePanelElementHidden(window, CONTROL_CENTER_PANEL);
   await gContentAPI.hideMenu(CONTROL_CENTER_MENU_NAME);
   await hidePromise;
 
   is_element_hidden(CONTROL_CENTER_PANEL, "Panel should hide after hideMenu");
 });
+
+add_UITour_task(async function test_showMenu_hideMenu_urlbarPopup() {
+  let shownPromise = promisePanelElementShown(window, gURLBar.popup);
+  await showMenuPromise("urlbar");
+  await shownPromise;
+  is(gURLBar.popup.state, "open", "The urlbar popup should open after showMenu");
+  is(gURLBar.controller.searchString, "Firefox", "Search string is Firefox");
+  let hidePromise = promisePanelElementHidden(window, gURLBar.popup);
+  await gContentAPI.hideMenu("urlbar");
+  await hidePromise;
+  is(gURLBar.popup.state, "closed", "The urlbar popup should close after hideMenu");
+});
+
+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");
+});
deleted file mode 100644
--- a/browser/components/uitour/test/browser_showMenu_urlbar.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-add_task(setup_UITourTest);
-
-var gTestTab;
-var gContentAPI;
-var gContentWindow;
-
-add_UITour_task(async function test_openSearchPanel() {
-  let urlbar = window.document.getElementById("urlbar");
-  urlbar.focus();
-  await showMenuPromise("urlbar");
-  is(urlbar.popup.state, "open", "Popup was opened");
-  is(urlbar.controller.searchString, "Firefox", "Search string is Firefox");
-  urlbar.popup.closePopup();
-  is(urlbar.popup.state, "closed", "Popup was closed");
-});
--- a/browser/components/uitour/test/head.js
+++ b/browser/components/uitour/test/head.js
@@ -131,16 +131,26 @@ function getConfigurationPromise(configN
   return ContentTask.spawn(gTestTab.linkedBrowser, configName, contentConfigName => {
     return new Promise((resolve) => {
       let contentWin = Components.utils.waiveXrays(content);
       contentWin.Mozilla.UITour.getConfiguration(contentConfigName, resolve);
     });
   });
 }
 
+function getShowHighlightTargetName() {
+  let highlight = document.getElementById("UITourHighlight");
+  return highlight.parentElement.getAttribute("targetName");
+}
+
+function getShowInfoTargetName() {
+  let tooltip = document.getElementById("UITourTooltip");
+  return tooltip.getAttribute("targetName");
+}
+
 function hideInfoPromise(...args) {
   let popup = document.getElementById("UITourTooltip");
   gContentAPI.hideInfo.apply(gContentAPI, args);
   return promisePanelElementHidden(window, popup);
 }
 
 /**
  * `buttons` and `options` require functions from the content scope so we take a