|
1 /* Any copyright is dedicated to the Public Domain. |
|
2 http://creativecommons.org/publicdomain/zero/1.0/ */ |
|
3 |
|
4 const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore); |
|
5 |
|
6 let state = { |
|
7 windows: [{ |
|
8 tabs: [{ |
|
9 entries: [{ url: "about:robots" }], |
|
10 hidden: true, |
|
11 extData: {"tabview-tab": '{"url":"about:robots","groupID":1,"bounds":{"left":20,"top":20,"width":20,"height":20}}'} |
|
12 },{ |
|
13 entries: [{ url: "about:robots" }], |
|
14 hidden: false, |
|
15 extData: {"tabview-tab": '{"url":"about:robots","groupID":2,"bounds":{"left":20,"top":20,"width":20,"height":20}}'}, |
|
16 }], |
|
17 selected: 2, |
|
18 extData: { |
|
19 "tabview-groups": '{"nextID":3,"activeGroupId":2, "totalNumber":2}', |
|
20 "tabview-group": |
|
21 '{"1":{"bounds":{"left":15,"top":5,"width":280,"height":232},"id":1},' + |
|
22 '"2":{"bounds":{"left":309,"top":5,"width":267,"height":226},"id":2}}' |
|
23 } |
|
24 }] |
|
25 }; |
|
26 |
|
27 function test() { |
|
28 waitForExplicitFinish(); |
|
29 testOne(); |
|
30 } |
|
31 |
|
32 function testOne() { |
|
33 newWindowWithTabView( |
|
34 function(win) { |
|
35 testTwo(); |
|
36 win.close(); |
|
37 }, |
|
38 function(win) { |
|
39 registerCleanupFunction(function() win.close()); |
|
40 is(win.document.getElementById("tabviewGroupsNumber").getAttribute("groups"), |
|
41 "1", "There is one group"); |
|
42 }); |
|
43 } |
|
44 |
|
45 function testTwo() { |
|
46 newWindowWithState(state, function(win) { |
|
47 registerCleanupFunction(function() win.close()); |
|
48 |
|
49 is(win.document.getElementById("tabviewGroupsNumber").getAttribute("groups"), |
|
50 "2", "There are two groups"); |
|
51 waitForFocus(finish); |
|
52 }); |
|
53 } |