Bug 1246635, enable browser_autofocus_preference.js in e10s, r=mrbkap

This commit is contained in:
Neil Deakin 2016-03-09 09:11:35 -05:00
Родитель 3c1f661ece
Коммит 01667b7d93
2 изменённых файлов: 13 добавлений и 20 удалений

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

@ -25,7 +25,6 @@ skip-if = e10s
[browser_autofocus_background.js]
skip-if= buildapp == 'mulet'
[browser_autofocus_preference.js]
skip-if = e10s
[browser_bug1238427.js]
skip-if = e10s
[browser_bug396843.js]

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

@ -1,24 +1,18 @@
function test() {
waitForExplicitFinish();
add_task(function* () {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [["browser.autofocus", false]]}, resolve);
});
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var gAutofocusPref = prefs.getBoolPref("browser.autofocus");
prefs.setBoolPref("browser.autofocus", false);
const url = "data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>";
gBrowser.selectedBrowser.addEventListener("load", function () {
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
gBrowser.selectedBrowser.loadURI(url);
yield loadedPromise;
executeSoon(function () {
is(gBrowser.selectedBrowser.contentDocument.activeElement,
gBrowser.selectedBrowser.contentDocument.body,
"foo");
yield new Promise(resolve => executeSoon(resolve));
prefs.setBoolPref("browser.autofocus", gAutofocusPref);
yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
is(content.document.activeElement, content.document.body, "body focused");
});
});
finish();
});
}, true);
gBrowser.selectedBrowser.loadURI("data:text/html,<!DOCTYPE html><html><body><input autofocus><button autofocus></button><textarea autofocus></textarea><select autofocus></select></body></html>");
}