michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: function test() { michael@0: let tab1 = gBrowser.selectedTab; michael@0: let tab2 = gBrowser.addTab("about:blank", {skipAnimation: true}); michael@0: let tab3 = gBrowser.addTab(); michael@0: gBrowser.selectedTab = tab2; michael@0: michael@0: gBrowser.removeCurrentTab({animate: true}); michael@0: gBrowser.tabContainer.advanceSelectedTab(-1, true); michael@0: is(gBrowser.selectedTab, tab1, "First tab should be selected"); michael@0: gBrowser.removeTab(tab2); michael@0: michael@0: // test for "null has no properties" fix. See Bug 585830 Comment 13 michael@0: gBrowser.removeCurrentTab({animate: true}); michael@0: try { michael@0: gBrowser.tabContainer.advanceSelectedTab(-1, false); michael@0: } catch(err) { michael@0: ok(false, "Shouldn't throw"); michael@0: } michael@0: michael@0: gBrowser.removeTab(tab1); michael@0: }