Bug 1000894 - fix browser-chrome tests in dom/tests/browser/ to not replace the original tab; r=ehsan

This commit is contained in:
Nathan Froyd 2014-04-24 21:02:59 -04:00
parent 314c3598f7
commit 673c634324
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,8 @@ function test() {
let fm = Components.classes["@mozilla.org/focus-manager;1"]
.getService(Components.interfaces.nsIFocusManager);
let tabs = [ gBrowser.selectedTab, gBrowser.addTab() ];
let tabs = [ gBrowser.addTab(), gBrowser.addTab() ];
gBrowser.selectedTab = tabs[0];
let testingList = [
{ uri: "data:text/html,<body onload=\"setTimeout(function () { document.getElementById('target').focus(); }, 10);\"><input id='target'></body>",
@ -61,7 +62,6 @@ function test() {
function runNextTest() {
if (++testingIndex >= testingList.length) {
// cleaning-up...
gBrowser.addTab();
for (let i = 0; i < tabs.length; i++) {
gBrowser.removeTab(tabs[i]);
}

View File

@ -13,7 +13,8 @@ function test() {
"<button id=\"eventTarget\" onmousedown=\"onMouseDown(event);\">click here</button>" +
"<input id=\"willBeFocused\"></body>";
let tab = gBrowser.selectedTab;
let tab = gBrowser.addTab();
gBrowser.selectedTab = tab;
// Set the focus to the contents.
tab.linkedBrowser.focus();
@ -52,7 +53,6 @@ function test() {
button);
}
gBrowser.addTab();
gBrowser.removeTab(tab);
finish();
}