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 TestRunner.run();
6 }
8 function runTests() {
9 function assertNumberOfTabs(num, msg) {
10 is(gBrowser.tabs.length, num, msg);
11 }
13 function assertNumberOfPinnedTabs(num, msg) {
14 is(gBrowser._numPinnedTabs, num, msg);
15 }
17 // check prerequisites
18 assertNumberOfTabs(1, "we start off with one tab");
19 assertNumberOfPinnedTabs(0, "no pinned tabs so far");
21 // setup
22 gBrowser.addTab("about:blank");
23 assertNumberOfTabs(2, "there are two tabs, now");
25 let [tab1, tab2] = gBrowser.tabs;
26 let linkedBrowser = tab1.linkedBrowser;
27 gBrowser.pinTab(tab1);
28 gBrowser.pinTab(tab2);
29 assertNumberOfPinnedTabs(2, "both tabs are now pinned");
31 // run the test
32 yield waitForBrowserState(
33 { windows: [{ tabs: [{ url: "about:blank" }] }] },
34 function () {
35 assertNumberOfTabs(1, "one tab left after setBrowserState()");
36 assertNumberOfPinnedTabs(0, "there are no pinned tabs");
37 is(gBrowser.tabs[0].linkedBrowser, linkedBrowser, "first tab's browser got re-used");
38 next();
39 }
40 );
41 }