browser/components/tabview/test/browser_tabview_bug633788.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 function test() {
michael@0 5 waitForExplicitFinish();
michael@0 6
michael@0 7 newWindowWithTabView(win => {
michael@0 8 is(win.gBrowser.tabs.length, 1, "There is only one tab");
michael@0 9
michael@0 10 let tab = win.gBrowser.tabs[0];
michael@0 11 let tabItem = tab._tabViewTabItem;
michael@0 12 ok(tabItem.parent, "The tab item belongs to a group");
michael@0 13 let groupId = tabItem.parent.id;
michael@0 14
michael@0 15 tab._tabViewTabItem.close();
michael@0 16
michael@0 17 whenTabViewIsHidden(function() {
michael@0 18 // a new tab with group should be opened
michael@0 19 is(win.gBrowser.tabs.length, 1, "There is still one tab");
michael@0 20 isnot(win.gBrowser.selectedTab, tab, "The tab is different");
michael@0 21
michael@0 22 tab = win.gBrowser.tabs[0];
michael@0 23 tabItem = tab._tabViewTabItem;
michael@0 24 ok(tabItem.parent, "This new tab item belongs to a group");
michael@0 25
michael@0 26 is(tabItem.parent.id, groupId, "The group is different");
michael@0 27
michael@0 28 promiseWindowClosed(win).then(finish);
michael@0 29 }, win);
michael@0 30 });
michael@0 31 }

mercurial