Bug 1231879 - Fix tests: getElementById returns null on failure, not undefined, r=mrbkap

This commit is contained in:
Steve Fink 2015-12-10 21:49:18 -08:00
parent 66c10aa734
commit c50e99c5d9
4 changed files with 9 additions and 9 deletions

View File

@ -325,7 +325,7 @@ add_task(function* testDefaultDetails() {
yield extension.unload();
let node = document.getElementById(pageActionId);
is(node, undefined, "pageAction image removed from document");
is(node, null, "pageAction image removed from document");
}
});

View File

@ -129,7 +129,7 @@ add_task(function* testPageActionPopup() {
panel.hidePopup();
panel = document.getElementById(panelId);
is(panel, undefined, "panel successfully removed from document after hiding");
is(panel, null, "panel successfully removed from document after hiding");
}
extension.sendMessage("next-test");
@ -141,5 +141,5 @@ add_task(function* testPageActionPopup() {
yield extension.unload();
let panel = document.getElementById(panelId);
is(panel, undefined, "browserAction panel removed from document");
is(panel, null, "browserAction panel removed from document");
});

View File

@ -226,12 +226,12 @@ add_task(function* testTabSwitchContext() {
yield extension.unload();
let node = document.getElementById(pageActionId);
is(node, undefined, "pageAction image removed from document");
is(node, null, "pageAction image removed from document");
currentWindow = null;
for (let win of windows.splice(0)) {
node = win.document.getElementById(pageActionId);
is(node, undefined, "pageAction image removed from second document");
is(node, null, "pageAction image removed from second document");
yield BrowserTestUtils.closeWindow(win);
}

View File

@ -137,7 +137,7 @@ add_task(function* testPageActionPopup() {
panel.hidePopup();
panel = document.getElementById(panelId);
is(panel, undefined, "panel successfully removed from document after hiding");
is(panel, null, "panel successfully removed from document after hiding");
}
extension.sendMessage("next-test");
@ -150,10 +150,10 @@ add_task(function* testPageActionPopup() {
yield extension.unload();
let node = document.getElementById(pageActionId);
is(node, undefined, "pageAction image removed from document");
is(node, null, "pageAction image removed from document");
let panel = document.getElementById(panelId);
is(panel, undefined, "pageAction panel removed from document");
is(panel, null, "pageAction panel removed from document");
});
@ -197,7 +197,7 @@ add_task(function* testPageActionSecurity() {
let pageActionId = makeWidgetId(extension.id) + "-page-action";
let node = document.getElementById(pageActionId);
is(node, undefined, "pageAction image removed from document");
is(node, null, "pageAction image removed from document");
SimpleTest.endMonitorConsole();
yield waitForConsole;