Bug 1027084 - Use about:blank as the initial tab for new windows in sessionstore tests r=smacleod

This commit is contained in:
Tim Taubert 2014-06-27 13:00:11 +02:00
parent 492476e6e9
commit 64de6a5ead
2 changed files with 13 additions and 5 deletions

View File

@ -226,7 +226,7 @@ function test() {
// Open a new window
// The previously closed window should be restored
whenNewWindowLoaded({}, function (newWin) {
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 1,
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 2,
"Restored window in-session with otherpopup windows around");
// Cleanup
@ -259,7 +259,7 @@ function test() {
// Exit private browsing mode again
whenNewWindowLoaded({}, function (newWin) {
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 1,
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 2,
"Restored after leaving private browsing again");
newWin.close();
@ -296,7 +296,7 @@ function test() {
// open a new window the previously closed window should be restored to
whenNewWindowLoaded({}, function (newWin) {
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 1,
is(newWin.gBrowser.browsers.length, TEST_URLS.length + 2,
"Restored window and associated tabs in session");
// Cleanup

View File

@ -73,7 +73,7 @@ function provideWindow(aCallback, aURL, aFeatures) {
});
}
let win = openDialog(getBrowserURL(), "", aFeatures || "chrome,all,dialog=no", aURL);
let win = openDialog(getBrowserURL(), "", aFeatures || "chrome,all,dialog=no", aURL || "about:blank");
whenWindowLoaded(win, function onWindowLoaded(aWin) {
if (!aURL) {
info("Loaded a blank window.");
@ -465,7 +465,15 @@ function closeAllButPrimaryWindow() {
* expected (e.g. reading a big session state from disk).
*/
function whenNewWindowLoaded(aOptions, aCallback) {
let win = OpenBrowserWindow(aOptions);
let features = "";
let url = "about:blank";
if (aOptions && aOptions.private || false) {
features = ",private";
url = "about:privatebrowsing";
}
let win = openDialog(getBrowserURL(), "", "chrome,all,dialog=no" + features, url);
whenDelayedStartupFinished(win, () => aCallback(win));
return win;
}