2011-02-27 17:36:36 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
2010-10-13 10:07:55 -07:00
|
|
|
let newWin;
|
|
|
|
function test() {
|
|
|
|
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
|
|
|
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
// open a new window and setup the window state.
|
|
|
|
newWin = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
|
2011-07-23 08:07:39 -07:00
|
|
|
newWin.addEventListener("load", function onLoad(event) {
|
|
|
|
this.removeEventListener("load", onLoad, false);
|
2010-10-13 10:07:55 -07:00
|
|
|
|
|
|
|
let newState = {
|
|
|
|
windows: [{
|
|
|
|
tabs: [{
|
|
|
|
entries: [{ "url": "about:blank" }],
|
|
|
|
hidden: true,
|
|
|
|
attributes: {},
|
|
|
|
extData: {
|
|
|
|
"tabview-tab":
|
|
|
|
'{"bounds":{"left":20,"top":35,"width":280,"height":210},' +
|
|
|
|
'"userSize":null,"url":"about:blank","groupID":1,' +
|
|
|
|
'"imageData":null,"title":null}'
|
|
|
|
}
|
|
|
|
},{
|
|
|
|
entries: [{ url: "about:blank" }],
|
|
|
|
index: 1,
|
|
|
|
hidden: false,
|
|
|
|
attributes: {},
|
|
|
|
extData: {
|
|
|
|
"tabview-tab":
|
|
|
|
'{"bounds":{"left":375,"top":35,"width":280,"height":210},' +
|
|
|
|
'"userSize":null,"url":"about:blank","groupID":2,' +
|
|
|
|
'"imageData":null,"title":null}'
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
selected:2,
|
|
|
|
_closedTabs: [],
|
|
|
|
extData: {
|
|
|
|
"tabview-groups": '{"nextID":3,"activeGroupId":2}',
|
|
|
|
"tabview-group":
|
|
|
|
'{"1":{"bounds":{"left":15,"top":10,"width":320,"height":375},' +
|
2011-01-27 23:07:30 -08:00
|
|
|
'"userSize":null,"title":"","id":1},' +
|
2010-10-13 10:07:55 -07:00
|
|
|
'"2":{"bounds":{"left":380,"top":5,"width":320,"height":375},' +
|
2011-01-27 23:07:30 -08:00
|
|
|
'"userSize":null,"title":"","id":2}}',
|
2010-10-13 10:07:55 -07:00
|
|
|
"tabview-ui": '{"pageBounds":{"left":0,"top":0,"width":875,"height":650}}'
|
|
|
|
}, sizemode:"normal"
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
ss.setWindowState(newWin, JSON.stringify(newState), true);
|
|
|
|
|
|
|
|
// add a new tab.
|
|
|
|
newWin.gBrowser.addTab();
|
|
|
|
is(newWin.gBrowser.tabs.length, 3, "There are 3 browser tabs");
|
|
|
|
|
|
|
|
let onTabViewShow = function() {
|
|
|
|
newWin.removeEventListener("tabviewshown", onTabViewShow, false);
|
|
|
|
|
2011-07-04 15:23:35 -07:00
|
|
|
let contentWindow = newWin.TabView.getContentWindow();
|
2010-10-13 10:07:55 -07:00
|
|
|
is(contentWindow.GroupItems.groupItems.length, 2, "Has two group items");
|
|
|
|
|
|
|
|
// clean up and finish
|
|
|
|
newWin.close();
|
|
|
|
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
newWin.addEventListener("tabviewshown", onTabViewShow, false);
|
2011-06-16 22:05:30 -07:00
|
|
|
waitForFocus(function() { newWin.TabView.toggle(); });
|
2010-10-13 10:07:55 -07:00
|
|
|
}, false);
|
|
|
|
}
|