browser/components/tabview/test/browser_tabview_bug619937.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:f355bb9791f3
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3
4 function test() {
5 waitForExplicitFinish();
6
7 window.addEventListener("tabviewshown", onTabViewWindowLoaded, false);
8 TabView.toggle();
9 }
10
11 function endGame() {
12 window.removeEventListener("tabviewhidden", endGame, false);
13 ok(!TabView.isVisible(), "Tab View is hidden");
14
15 finish();
16 };
17
18 function onTabViewWindowLoaded() {
19 window.removeEventListener("tabviewshown", onTabViewWindowLoaded, false);
20 ok(TabView.isVisible(), "Tab View is visible");
21
22 let contentWindow = document.getElementById("tab-view").contentWindow;
23
24 // establish initial state
25 is(contentWindow.GroupItems.groupItems.length, 1,
26 "we start with one group (the default)");
27 is(gBrowser.tabs.length, 1, "we start with one tab");
28 let originalTab = gBrowser.tabs[0];
29
30 let bg = contentWindow.document.getElementById("bg");
31
32 EventUtils.sendMouseEvent({ type: "click" }, bg, contentWindow);
33
34 is(contentWindow.GroupItems.groupItems.length, 1,
35 "we should still only have one group");
36
37 window.addEventListener("tabviewhidden", endGame, false);
38 TabView.toggle();
39 }

mercurial