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
Родитель 58381931a4
Коммит 90a409e6f3
2 изменённых файлов: 4 добавлений и 33 удалений

Просмотреть файл

@ -1,8 +1,6 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */ 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 = "http://mochi.test:8888/browser/browser/base/content/test/tabview/dummy_page.html";
const DUMMY_PAGE_URL_2 = "http://mochi.test:8888/"; const DUMMY_PAGE_URL_2 = "http://mochi.test:8888/";
@ -54,10 +52,7 @@ function test() {
testTabSwitchAfterRestore(function () { testTabSwitchAfterRestore(function () {
Services.prefs.setBoolPref("browser.sessionstore.restore_hidden_tabs", true); Services.prefs.setBoolPref("browser.sessionstore.restore_hidden_tabs", true);
testTabSwitchAfterRestore(finish);
testTabSwitchAfterRestore(function () {
waitForFocus(finish);
});
}); });
} }
@ -92,30 +87,3 @@ function testTabSwitchAfterRestore(callback) {
win.switchToTabHavingURI(DUMMY_PAGE_URL); 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);
}

Просмотреть файл

@ -290,6 +290,9 @@ function whenWindowStateReady(win, callback) {
// ---------- // ----------
function newWindowWithState(state, 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 opts = "chrome,all,dialog=no,height=800,width=800";
let win = window.openDialog(getBrowserURL(), "_blank", opts); let win = window.openDialog(getBrowserURL(), "_blank", opts);