Bug 1500959 - Clean up browser_visibleTabs_tabPreview.js. r=Standard8
authorDão Gottwald <dao@mozilla.com>
Wed, 24 Oct 2018 18:00:22 +0000
changeset 491301 88351e371a8b8c21dc69555f53707a8fae6df40a
parent 491300 b7781d888fa1359989445e131a1c107a34e6368f
child 491302 95fc220097602f6527926c706877497d00b61c86
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersStandard8
bugs1500959
milestone65.0a1
Bug 1500959 - Clean up browser_visibleTabs_tabPreview.js. r=Standard8 Differential Revision: https://phabricator.services.mozilla.com/D9650
browser/base/content/test/general/browser_visibleTabs_tabPreview.js
--- a/browser/base/content/test/general/browser_visibleTabs_tabPreview.js
+++ b/browser/base/content/test/general/browser_visibleTabs_tabPreview.js
@@ -6,30 +6,29 @@ add_task(async function test() {
   await SpecialPowers.pushPrefEnv({"set": [["browser.ctrlTab.recentlyUsedOrder", true]]});
 
   let [origTab] = gBrowser.visibleTabs;
   let tabOne = BrowserTestUtils.addTab(gBrowser);
   let tabTwo = BrowserTestUtils.addTab(gBrowser);
 
   // test the ctrlTab.tabList
   pressCtrlTab();
-  is(ctrlTab.tabList.length, 3, "Show 3 tabs in tab preview");
+  ok(ctrlTab.isOpen, "With 3 tab open, Ctrl+Tab opens the preview panel");
+  is(ctrlTab.tabList.length, 3, "Ctrl+Tab panel displays all visible tabs");
   releaseCtrl();
 
   gBrowser.showOnlyTheseTabs([origTab]);
   pressCtrlTab();
-
-  // XXX: Switched to from ok() to todo_is() in Bug 1467712. Follow up in 1500959
-  // `ctrlTab.tabList.length` is still equal to 3 at this step.
-  todo_is(ctrlTab.tabList.length, 1, "Show 1 tab in tab preview");
   ok(!ctrlTab.isOpen, "With 1 tab open, Ctrl+Tab doesn't open the preview panel");
+  releaseCtrl();
 
   gBrowser.showOnlyTheseTabs([origTab, tabOne, tabTwo]);
   pressCtrlTab();
-  ok(ctrlTab.isOpen, "With 3 tabs open, Ctrl+Tab does open the preview panel");
+  ok(ctrlTab.isOpen, "Ctrl+Tab opens the preview panel after re-showing hidden tabs");
+  is(ctrlTab.tabList.length, 3, "Ctrl+Tab panel displays all visible tabs after re-showing hidden ones");
   releaseCtrl();
 
   // cleanup
   gBrowser.removeTab(tabOne);
   gBrowser.removeTab(tabTwo);
 });
 
 function pressCtrlTab(aShiftKey) {