browser/components/tabview/test/browser_tabview_bug604098.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:eee76f1011fd
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 let contentWindow;
5 let contentElement;
6
7 function test() {
8 waitForExplicitFinish();
9
10 registerCleanupFunction(function() {
11 if (gBrowser.tabs.length > 1)
12 gBrowser.removeTab(gBrowser.tabs[1]);
13 hideTabView();
14 });
15
16 showTabView(function() {
17 contentWindow = TabView.getContentWindow();
18 contentElement = contentWindow.document.getElementById("content");
19 test1();
20 });
21 }
22
23 function test1() {
24 let groupItems = contentWindow.GroupItems.groupItems;
25 is(groupItems.length, 1, "there is one groupItem");
26
27 whenTabViewIsHidden(function() {
28 gBrowser.selectedTab = gBrowser.tabs[0];
29 is(groupItems.length, 2, "there are two groupItems");
30 closeGroupItem(groupItems[1], finish);
31 });
32
33 // double click
34 doubleClick(contentElement, 0);
35 }
36
37 function doubleClick(targetElement, buttonCode) {
38 EventUtils.sendMouseEvent(
39 { type: "dblclick", button: buttonCode }, targetElement, contentWindow);
40 }
41

mercurial