browser/base/content/test/general/browser_bug585830.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/test/general/browser_bug585830.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,25 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +function test() {
     1.9 +  let tab1 = gBrowser.selectedTab;
    1.10 +  let tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
    1.11 +  let tab3 = gBrowser.addTab();
    1.12 +  gBrowser.selectedTab = tab2;
    1.13 +  
    1.14 +  gBrowser.removeCurrentTab({animate: true});
    1.15 +  gBrowser.tabContainer.advanceSelectedTab(-1, true);
    1.16 +  is(gBrowser.selectedTab, tab1, "First tab should be selected");
    1.17 +  gBrowser.removeTab(tab2);
    1.18 +  
    1.19 +  // test for "null has no properties" fix. See Bug 585830 Comment 13
    1.20 +  gBrowser.removeCurrentTab({animate: true});
    1.21 +  try {
    1.22 +    gBrowser.tabContainer.advanceSelectedTab(-1, false);
    1.23 +  } catch(err) {
    1.24 +    ok(false, "Shouldn't throw");
    1.25 +  }
    1.26 +  
    1.27 +  gBrowser.removeTab(tab1);
    1.28 +}

mercurial