Bug 932880 - Small cleanups and fixes for browser_dbg_clean-exit-window.js. r=fitzgen

This commit is contained in:
Panos Astithas 2013-11-01 20:09:50 +02:00
Родитель 7d32f2051b
Коммит e0d82a1351
2 изменённых файлов: 10 добавлений и 8 удалений

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

@ -18,23 +18,21 @@ function test() {
gDebugger = gPanel.panelWin;
gWindow = aWindow;
return testCleanExit(gWindow);
return testCleanExit();
})
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
}
function testCleanExit(aWindow) {
function testCleanExit() {
let deferred = promise.defer();
gWindow = aWindow;
ok(!!gWindow, "Second window created.");
gWindow.focus();
let topWindow = Services.wm.getMostRecentWindow("navigator:browser");
is(topWindow, gWindow,
is(Services.wm.getMostRecentWindow("navigator:browser"), gWindow,
"The second window is on top.");
let isActive = promise.defer();
@ -67,8 +65,7 @@ function testCleanExit(aWindow) {
isActive.resolve();
}
let contentLocation = gWindow.content.location.href;
if (contentLocation != TAB_URL) {
if (gWindow.content.location.href != TAB_URL) {
gWindow.document.addEventListener("load", function onLoad(aEvent) {
if (aEvent.target.documentURI != TAB_URL) {
return;

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

@ -547,7 +547,12 @@ BrowserTabActor.prototype = {
* Tab URL.
*/
get url() {
return this.browser.currentURI.spec;
if (this.browser.currentURI) {
return this.browser.currentURI.spec;
}
// Abrupt closing of the browser window may leave callbacks without a
// currentURI.
return null;
},
/**