Bug 663813 - clean up browser_tabview_bug589324.js; f=raymond, r=dietrich

This commit is contained in:
Tim Taubert 2011-06-14 10:41:18 +02:00
parent 1b4badace3
commit 21bb9a7472
2 changed files with 4 additions and 33 deletions

View File

@ -1,8 +1,6 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
const DUMMY_PAGE_URL = "http://mochi.test:8888/browser/browser/base/content/test/tabview/dummy_page.html";
const DUMMY_PAGE_URL_2 = "http://mochi.test:8888/";
@ -54,10 +52,7 @@ function test() {
testTabSwitchAfterRestore(function () {
Services.prefs.setBoolPref("browser.sessionstore.restore_hidden_tabs", true);
testTabSwitchAfterRestore(function () {
waitForFocus(finish);
});
testTabSwitchAfterRestore(finish);
});
}
@ -92,30 +87,3 @@ function testTabSwitchAfterRestore(callback) {
win.switchToTabHavingURI(DUMMY_PAGE_URL);
});
}
function newWindowWithState(state, callback) {
let opts = "chrome,all,dialog=no,height=800,width=800";
let win = window.openDialog(getBrowserURL(), "_blank", opts);
whenWindowLoaded(win, function () {
ss.setWindowState(win, JSON.stringify(state), true);
});
whenWindowStateReady(win, function () {
afterAllTabsLoaded(function () callback(win), win);
});
}
function whenWindowLoaded(win, callback) {
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad, false);
executeSoon(callback);
}, false);
}
function whenWindowStateReady(win, callback) {
win.addEventListener("SSWindowStateReady", function onReady() {
win.removeEventListener("SSWindowStateReady", onReady, false);
executeSoon(callback);
}, false);
}

View File

@ -290,6 +290,9 @@ function whenWindowStateReady(win, callback) {
// ----------
function newWindowWithState(state, callback) {
const ss = Cc["@mozilla.org/browser/sessionstore;1"]
.getService(Ci.nsISessionStore);
let opts = "chrome,all,dialog=no,height=800,width=800";
let win = window.openDialog(getBrowserURL(), "_blank", opts);