Backed out changeset a8173e5fd041

This commit is contained in:
Dão Gottwald 2009-03-14 22:00:18 +01:00
Родитель e0c6afd5ae
Коммит ccb86b994b
3 изменённых файлов: 1 добавлений и 92 удалений

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

@ -145,11 +145,7 @@ function restoreSession() {
}
function startNewSession() {
var prefBranch = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
if (prefBranch.getIntPref("browser.startup.page") == 0)
getBrowserWindow().gBrowser.loadURI("about:blank");
else
getBrowserWindow().BrowserHome();
getBrowserWindow().BrowserHome();
}
function onListClick(aEvent) {

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

@ -77,7 +77,6 @@ _BROWSER_TEST_FILES = \
browser_476161.js \
browser_476161_sample.html \
browser_480148.js \
browser_480893.js \
$(NULL)
libs:: $(_BROWSER_TEST_FILES)

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

@ -1,86 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is sessionstore test code.
*
* The Initial Developer of the Original Code is
* Michael Kohler <michaelkohler@live.com>.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
function test() {
/** Test for Bug 480893 **/
waitForExplicitFinish();
// Test that starting a new session loads a blank page if Firefox is
// configured to display a blank page at startup (browser.startup.page = 0)
gPrefService.setIntPref("browser.startup.page", 0);
let tab = gBrowser.addTab("about:sessionrestore");
gBrowser.selectedTab = tab;
let browser = tab.linkedBrowser;
browser.addEventListener("load", function(aEvent) {
this.removeEventListener("load", arguments.callee, true);
let doc = browser.contentDocument;
// click on the "Start New Session" button after about:sessionrestore is loaded
doc.getElementById("errorCancel").click();
browser.addEventListener("load", function(aEvent) {
this.removeEventListener("load", arguments.callee, true);
let doc = browser.contentDocument;
is(doc.URL, "about:blank", "loaded page is about:blank");
// Test that starting a new session loads a different page than
// about:sessionrestore / about:blank if Firefox is configured
// to display a homepage at startup (browser.startup.page = 1)
gPrefService.setIntPref("browser.startup.page", 1);
gBrowser.loadURI("about:sessionrestore");
browser.addEventListener("load", function(aEvent) {
this.removeEventListener("load", arguments.callee, true);
let doc = browser.contentDocument;
// click on the "Start New Session" button after about:sessionrestore is loaded
doc.getElementById("errorCancel").click();
browser.addEventListener("load", function(aEvent) {
this.removeEventListener("load", arguments.callee, true);
let doc = browser.contentDocument;
isnot(doc.URL, "about:sessionrestore", "something else than about:sessionrestore has been loaded");
isnot(doc.URL, "about:blank", "something else than about:blank has been loaded");
// close tab, restore default browser.startup.page value and finish the test
gBrowser.removeTab(tab);
gPrefService.clearUserPref("browser.startup.page");
finish();
}, true);
}, true);
}, true);
}, true);
}