Bug 982620 - UITour: Test that the menu panel is closed after tearing down. r=Gijs
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Sat, 15 Mar 2014 11:21:43 -0700
changeset 192017 60da49f4d2004c20f47917fa3da2658ab9c81b4e
parent 192016 242281e4bcd0974ac04d9cc4f559bcca23c67853
child 192018 20a6cc189fddb01c1a7d94bb34c1e8c80e0f5a81
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs982620
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 982620 - UITour: Test that the menu panel is closed after tearing down. r=Gijs [Australis]
browser/modules/test/browser_UITour.js
browser/modules/test/head.js
--- a/browser/modules/test/browser_UITour.js
+++ b/browser/modules/test/browser_UITour.js
@@ -246,9 +246,15 @@ let tests = [
         is(desc.textContent, "search text", "Popup should have correct description text");
 
         done();
       });
     });
 
     gContentAPI.showInfo("urlbar", "urlbar title", "urlbar text");
   },
+
+  // Make sure this test is last in the file so the appMenu gets left open and done will confirm it got tore down.
+  function cleanupMenus(done) {
+    gContentAPI.showMenu("appMenu");
+    done();
+  },
 ];
--- a/browser/modules/test/head.js
+++ b/browser/modules/test/head.js
@@ -123,16 +123,19 @@ function UITourTest() {
 
       let highlight = document.getElementById("UITourHighlightContainer");
       is_element_hidden(highlight, "Highlight should be closed/hidden after UITour tab is closed");
 
       let tooltip = document.getElementById("UITourTooltip");
       is_element_hidden(tooltip, "Tooltip should be closed/hidden after UITour tab is closed");
 
       ok(!PanelUI.panel.hasAttribute("noautohide"), "@noautohide on the menu panel should have been cleaned up");
+      ok(!PanelUI.panel.hasAttribute("panelopen"), "The panel shouldn't have @panelopen");
+      isnot(PanelUI.panel.state, "open", "The panel shouldn't be open");
+      is(document.getElementById("PanelUI-menu-button").hasAttribute("open"), false, "Menu button should know that the menu is closed");
 
       is(UITour.pinnedTabs.get(window), null, "Any pinned tab should be closed after UITour tab is closed");
 
       executeSoon(nextTest);
     });
   }
 
   function nextTest() {