browser/components/tabview/test/browser_tabview_bug596781.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 let newTab;
michael@0 5
michael@0 6 function test() {
michael@0 7 waitForExplicitFinish();
michael@0 8
michael@0 9 newTab = gBrowser.addTab();
michael@0 10 gBrowser.pinTab(newTab);
michael@0 11
michael@0 12 window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
michael@0 13 TabView.toggle();
michael@0 14 }
michael@0 15
michael@0 16 function onTabViewWindowLoaded() {
michael@0 17 window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
michael@0 18 ok(TabView.isVisible(), "Tab View is visible");
michael@0 19
michael@0 20 let contentWindow = document.getElementById("tab-view").contentWindow;
michael@0 21
michael@0 22 is(contentWindow.GroupItems.groupItems.length, 1, "Only one group exists");
michael@0 23 is(gBrowser.tabs.length, 2, "Only one tab exists");
michael@0 24 ok(newTab.pinned, "The original tab is pinned");
michael@0 25
michael@0 26 let groupItem = contentWindow.GroupItems.groupItems[0];
michael@0 27 is(groupItem.$closeButton[0].style.display, "none",
michael@0 28 "The close button is hidden");
michael@0 29
michael@0 30 gBrowser.unpinTab(newTab);
michael@0 31 is(groupItem.$closeButton[0].style.display, "",
michael@0 32 "The close button is visible");
michael@0 33
michael@0 34 let onTabViewHidden = function() {
michael@0 35 window.removeEventListener("tabviewhidden", onTabViewHidden, false);
michael@0 36 gBrowser.removeTab(newTab);
michael@0 37 finish();
michael@0 38 }
michael@0 39 window.addEventListener("tabviewhidden", onTabViewHidden, false);
michael@0 40 TabView.toggle();
michael@0 41 }

mercurial