Bug 1137141: extend Loop toolbarbutton tests to check for correct panel states upon opening. r=Standard8
authorMike de Boer <mdeboer@mozilla.com>
Fri, 27 Feb 2015 12:25:20 +0100
changeset 261453 cb5051165c85a4e6a3c50a20ede943effb0df8da
parent 261452 52e496c8a9fad96720e5afd1441c4ac59610ef69
child 261454 54d3bf38ca10c3c04db9d7bee35582ee19c5eae5
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1137141
milestone39.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 1137141: extend Loop toolbarbutton tests to check for correct panel states upon opening. r=Standard8
browser/components/loop/test/mochitest/browser_toolbarbutton.js
--- a/browser/components/loop/test/mochitest/browser_toolbarbutton.js
+++ b/browser/components/loop/test/mochitest/browser_toolbarbutton.js
@@ -33,26 +33,34 @@ add_task(function* test_LoopUI_getters()
   Assert.ok(LoopUI.panel, "LoopUI panel element should be set");
   Assert.strictEqual(LoopUI.browser, null, "Browser element should not be there yet");
   Assert.strictEqual(LoopUI.selectedTab, null, "No tab should be selected yet");
 
   // Load and show the Loop panel for the very first time this session.
   yield loadLoopPanel();
   Assert.ok(LoopUI.browser, "Browser element should be there");
   Assert.strictEqual(LoopUI.selectedTab, "rooms", "Initially the rooms tab should be selected");
+  let panelTabs = LoopUI.browser.contentDocument.querySelectorAll(".tab-view > li");
+  Assert.strictEqual(panelTabs.length, 1, "Only one tab, 'rooms', should be visible");
 
   // Hide the panel.
   yield LoopUI.togglePanel();
   Assert.strictEqual(LoopUI.selectedTab, "rooms", "Rooms tab should still be selected");
 
   // Make sure the contacts tab shows up by simulating a login.
   MozLoopServiceInternal.fxAOAuthTokenData = fxASampleToken;
   MozLoopServiceInternal.fxAOAuthProfile = fxASampleProfile;
   yield MozLoopServiceInternal.notifyStatusChanged("login");
 
+  yield LoopUI.togglePanel();
+  Assert.strictEqual(LoopUI.selectedTab, "rooms", "Rooms tab should still be selected");
+  panelTabs = LoopUI.browser.contentDocument.querySelectorAll(".tab-view > li");
+  Assert.strictEqual(panelTabs.length, 2, "Two tabs should be visible");
+  yield LoopUI.togglePanel();
+
   // Programmatically select the contacts tab.
   yield LoopUI.togglePanel(null, "contacts");
   Assert.strictEqual(LoopUI.selectedTab, "contacts", "Contacts tab should be selected now");
 
   // Switch back to the rooms tab.
   yield LoopUI.openCallPanel(null, "rooms");
   Assert.strictEqual(LoopUI.selectedTab, "rooms", "Rooms tab should be selected now");