Commit 60786535 authored by Butkovits Atila's avatar Butkovits Atila
Browse files

Backed out changeset 626d66f4050f (bug 1731050) for causing failures at...

Backed out changeset 626d66f4050f (bug 1731050) for causing failures at browser_datachoices_notification.js. CLOSED TREE
parent 1de3c481
Loading
Loading
Loading
Loading
+4 −19
Original line number Diff line number Diff line
@@ -575,13 +575,6 @@ var ctrlTab = {
          this.removeClosingTabFromUI(event.target);
        }
        break;
      case "TabHide":
        this.detachTab(event.target);
        break;
      case "TabShow":
        this.attachTab(event.target);
        this._sortRecentlyUsedTabs();
        break;
      case "keydown":
        this.onKeyDown(event);
        break;
@@ -647,17 +640,11 @@ var ctrlTab = {

    aCallback(urls);
  },
  _sortRecentlyUsedTabs() {
    this._recentlyUsedTabs.sort(
      (tab1, tab2) => tab2.lastAccessed - tab1.lastAccessed
    );
  },

  _initRecentlyUsedTabs() {
    this._recentlyUsedTabs = Array.prototype.filter.call(
      gBrowser.tabs,
      tab => !tab.closing && !tab.hidden
    );
    this._sortRecentlyUsedTabs();
    this._recentlyUsedTabs = Array.prototype.filter
      .call(gBrowser.tabs, tab => !tab.closing)
      .sort((tab1, tab2) => tab2.lastAccessed - tab1.lastAccessed);
  },

  _init: function ctrlTab__init(enable) {
@@ -672,8 +659,6 @@ var ctrlTab = {
    tabContainer[toggleEventListener]("TabAttrModified", this);
    tabContainer[toggleEventListener]("TabSelect", this);
    tabContainer[toggleEventListener]("TabClose", this);
    tabContainer[toggleEventListener]("TabHide", this);
    tabContainer[toggleEventListener]("TabShow", this);

    if (enable) {
      Services.els.addSystemEventListener(document, "keydown", this, false);
+0 −37
Original line number Diff line number Diff line
@@ -143,43 +143,6 @@ add_task(async function() {
    );
  }

  // eslint-disable-next-line no-lone-blocks
  {
    // Bug 1731050: test hidden tabs
    info("Starting hidden tabs test");
    checkTabs(1);
    await BrowserTestUtils.addTab(gBrowser);
    await BrowserTestUtils.addTab(gBrowser);
    await BrowserTestUtils.addTab(gBrowser);
    await BrowserTestUtils.addTab(gBrowser);

    selectTabs([1, 2, 3, 4, 3]);
    gBrowser.hideTab(gBrowser.tabs[4]);
    selectTabs([2]);
    gBrowser.hideTab(gBrowser.tabs[3]);

    is(gBrowser.tabs[4].hidden, true, "Tab at index 4 is hidden");
    is(gBrowser.tabs[3].hidden, true, "Tab at index 3 is hidden");
    is(gBrowser.tabs[2].hidden, false, "Tab at index 2 is still shown");
    is(gBrowser.tabs[1].hidden, false, "Tab at index 1 is still shown");
    is(gBrowser.tabs[0].hidden, false, "Tab at index 0 is still shown");

    ctrlTabTest([], 1, 1);
    ctrlTabTest([], 2, 1);
    gBrowser.showTab(gBrowser.tabs[4]);
    ctrlTabTest([2], 3, 4);
    ctrlTabTest([], 5, 4);
    gBrowser.showTab(gBrowser.tabs[3]);
    ctrlTabTest([], 4, 3);
    ctrlTabTest([], 6, 4);

    await BrowserTestUtils.removeTab(gBrowser.tabs[4]);
    await BrowserTestUtils.removeTab(gBrowser.tabs[3]);
    await BrowserTestUtils.removeTab(gBrowser.tabs[2]);
    await BrowserTestUtils.removeTab(gBrowser.tabs[1]);
    info("End hidden tabs test");
  }

  /* private utility functions */

  function pressCtrlTab(aShiftKey) {