Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 function test() {
5 test_tab("about:blank");
6 test_tab("about:license");
7 }
9 function test_tab(url) {
10 let originalTab = gBrowser.selectedTab;
11 let newTab = gBrowser.addTab(url, {skipAnimation: true});
12 is(tabIsActive(newTab), false, "newly added " + url + " tab is not active");
13 is(tabIsActive(originalTab), true, "original tab is active initially");
15 gBrowser.selectedTab = newTab;
16 is(tabIsActive(newTab), true, "newly added " + url + " tab is active after selection");
17 is(tabIsActive(originalTab), false, "original tab is not active while unselected");
19 gBrowser.selectedTab = originalTab;
20 is(tabIsActive(newTab), false, "newly added " + url + " tab is not active after switch back");
21 is(tabIsActive(originalTab), true, "original tab is active again after switch back");
23 gBrowser.removeTab(newTab);
24 }
26 function tabIsActive(tab) {
27 let browser = tab.linkedBrowser;
28 return browser.docShell.isActive;
29 }