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 showTabView(function() {
8 registerCleanupFunction(function() {
9 if (gBrowser.tabs[1])
10 gBrowser.removeTab(gBrowser.tabs[1]);
11 TabView.hide();
12 });
14 let contentWindow = TabView.getContentWindow();
15 let groupItem = createEmptyGroupItem(contentWindow, 200, 200, 20);
16 contentWindow.GroupItems.setActiveGroupItem(groupItem);
18 // A new tab should be added to the active group and tabview should zoom into it.
19 is(groupItem.getChildren().length, 0, "This group doesn't have any tabitems");
20 whenTabViewIsHidden(function() {
21 is(groupItem.getChildren().length, 1, "This group has one tabitem");
23 showTabView(function() {
24 // Ensure that no new tab is added to this non-empty tab group.
25 whenTabViewIsHidden(function() {
26 let tabItems = groupItem.getChildren();
27 is(tabItems.length, 1, "This group has one tabitem");
28 is(tabItems[0].tab, gBrowser.selectedTab, "The same tab");
30 tabItems[0].close();
31 groupItem.close();
33 finish();
34 });
35 EventUtils.synthesizeKey("VK_RETURN", {}, contentWindow);
36 });
37 });
38 EventUtils.synthesizeKey("VK_RETURN", {}, contentWindow);
39 });
40 }