Bug 1179753 - Use pushPrefEnv more in worker tests; r=baku

This commit is contained in:
Ehsan Akhgari 2015-07-02 09:00:50 -04:00
parent d91f02ec18
commit 2d6aada293
2 changed files with 10 additions and 18 deletions

View File

@ -11,11 +11,6 @@
const Ci = Components.interfaces;
var mainWindow;
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefBranch.setIntPref("browser.startup.page", 0);
prefBranch.setCharPref("browser.startup.homepage_override.mstone", "ignore");
var contentPage = "http://mochi.test:8888/chrome/dom/workers/test/empty.html";
function testOnWindow(aIsPrivate, aCallback) {
@ -74,9 +69,6 @@ function runTest() {
wN.close();
wP.close();
prefBranch.clearUserPref("browser.startup.page")
prefBranch.clearUserPref("browser.startup.homepage_override.mstone");
SimpleTest.finish();
return;
}
@ -86,7 +78,11 @@ function runTest() {
}
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [["dom.serviceWorkers.enabled", true]]}, runTest);
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.enabled", true],
["browser.startup.page", 0],
["browser.startup.homepage_override.mstone", "ignore"],
]}, runTest);
</script>
</body>

View File

@ -11,11 +11,6 @@
const Ci = Components.interfaces;
var mainWindow;
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefBranch.setIntPref("browser.startup.page", 0);
prefBranch.setCharPref("browser.startup.homepage_override.mstone", "ignore");
var contentPage = "http://mochi.test:8888/chrome/dom/workers/test/empty.html";
function testOnWindow(aIsPrivate, aCallback) {
@ -87,9 +82,6 @@ function runTest() {
wN.close();
wP.close();
prefBranch.clearUserPref("browser.startup.page")
prefBranch.clearUserPref("browser.startup.homepage_override.mstone");
SimpleTest.finish();
return;
}
@ -99,7 +91,11 @@ function runTest() {
}
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [["dom.workers.sharedWorkers.enabled", true]]}, runTest);
SpecialPowers.pushPrefEnv({"set": [
["dom.workers.sharedWorkers.enabled", true],
["browser.startup.page", 0],
["browser.startup.homepage_override.mstone", "ignore"],
]}, runTest);
</script>
</body>