Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 function test() {
5 waitForExplicitFinish();
7 let AllTabs;
8 let newTab = gBrowser.addTab();
10 // TabPinned
11 let pinned = function (event) {
12 let tab = event.target;
14 is(tab, newTab, "The tabs are the same after the tab is pinned");
15 ok(tab.pinned, "The tab gets pinned");
17 gBrowser.unpinTab(tab);
18 };
20 // TabUnpinned
21 let unpinned = function (event) {
22 let tab = event.target;
24 AllTabs.unregister("pinned", pinned);
25 AllTabs.unregister("unpinned", unpinned);
27 is(tab, newTab, "The tabs are the same after the tab is unpinned");
28 ok(!tab.pinned, "The tab gets unpinned");
30 // clean up and finish
31 gBrowser.removeTab(tab);
32 hideTabView(finish);
33 };
35 showTabView(function () {
36 AllTabs = TabView.getContentWindow().AllTabs;
38 AllTabs.register("pinned", pinned);
39 AllTabs.register("unpinned", unpinned);
41 ok(!newTab.pinned, "The tab is not pinned");
42 gBrowser.pinTab(newTab);
43 });
44 }