Bug 1232029 - Set some prefs that some tests rely on explicitly; r=bkelly

This commit is contained in:
Ehsan Akhgari 2016-03-01 10:08:35 -05:00
parent 70b9a6a8df
commit f11b6b5e77
15 changed files with 37 additions and 0 deletions

View File

@ -16,6 +16,7 @@ const TAB_URL = HTTP_ROOT + "service-workers/empty-sw.html";
add_task(function* () {
yield new Promise(done => {
let options = {"set": [
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
]};
SpecialPowers.pushPrefEnv(options, done);

View File

@ -56,6 +56,7 @@ let startTest = Task.async(function*() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.enabled", true],
["devtools.webconsole.filter.serviceworkers", true]
]}, resolve);
});

View File

@ -49,6 +49,7 @@ let startTest = Task.async(function*() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.enabled", true],
["devtools.webconsole.filter.serviceworkers", true]
]}, resolve);
});

View File

@ -68,6 +68,7 @@ http://creativecommons.org/licenses/publicdomain/
SpecialPowers.addPermission("desktop-notification", false, document);
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]

View File

@ -120,6 +120,7 @@ http://creativecommons.org/licenses/publicdomain/
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]

View File

@ -115,6 +115,7 @@ http://creativecommons.org/licenses/publicdomain/
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]

View File

@ -102,6 +102,7 @@ var defaultServerURL = SpecialPowers.getCharPref("dom.push.serverURL");
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],

View File

@ -323,6 +323,7 @@
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],

View File

@ -289,6 +289,7 @@ http://creativecommons.org/licenses/publicdomain/
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]

View File

@ -81,6 +81,7 @@ http://creativecommons.org/licenses/publicdomain/
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]

View File

@ -19,6 +19,7 @@ function setupPrefs() {
return new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["dom.push.enabled", true],
["dom.push.connection.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]

View File

@ -9,6 +9,8 @@ const {PushDB, PushService, PushServiceHttp2} = serviceExports;
var prefs;
var tlsProfile;
var pushEnabled;
var pushConnectionEnabled;
var serverPort = -1;
@ -19,14 +21,19 @@ function run_test() {
dump("using port " + serverPort + "\n");
do_get_profile();
setPrefs();
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
pushEnabled = prefs.getBoolPref("dom.push.enabled");
pushConnectionEnabled = prefs.getBoolPref("dom.push.connection.enabled");
// Set to allow the cert presented by our H2 server
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
prefs.setBoolPref("dom.push.enabled", true);
prefs.setBoolPref("dom.push.connection.enabled", true);
addCertOverride("localhost", serverPort,
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
@ -155,4 +162,6 @@ add_task(function* test_pushNotifications() {
add_task(function* test_complete() {
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
prefs.setBoolPref("dom.push.enabled", pushEnabled);
prefs.setBoolPref("dom.push.connection.enabled", pushConnectionEnabled);
});

View File

@ -11,6 +11,8 @@ var prefs;
var tlsProfile;
var serverURL;
var serverPort = -1;
var pushEnabled;
var pushConnectionEnabled;
var db;
function run_test() {
@ -22,11 +24,15 @@ function run_test() {
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
pushEnabled = prefs.getBoolPref("dom.push.enabled");
pushConnectionEnabled = prefs.getBoolPref("dom.push.connection.enabled");
// Set to allow the cert presented by our H2 server
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
prefs.setBoolPref("dom.push.enabled", true);
prefs.setBoolPref("dom.push.connection.enabled", true);
addCertOverride("localhost", serverPort,
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
@ -119,4 +125,6 @@ add_task(function* test_pushSubscriptionMissingLink2() {
add_task(function* test_complete() {
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
prefs.setBoolPref("dom.push.enabled", pushEnabled);
prefs.setBoolPref("dom.push.connection.enabled", pushConnectionEnabled);
});

View File

@ -53,6 +53,7 @@ function run_test() {
servicePrefs.set('testing.notifyWorkers', false);
servicePrefs.set('testing.notifyAllObservers', true);
setPrefs();
run_next_test();
}

View File

@ -18,6 +18,8 @@ const {PushDB, PushService, PushServiceHttp2} = serviceExports;
var prefs;
var tlsProfile;
var pushEnabled;
var pushConnectionEnabled;
var serverPort = -1;
@ -30,11 +32,15 @@ function run_test() {
prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
tlsProfile = prefs.getBoolPref("network.http.spdy.enforce-tls-profile");
pushEnabled = prefs.getBoolPref("dom.push.enabled");
pushConnectionEnabled = prefs.getBoolPref("dom.push.connection.enabled");
// Set to allow the cert presented by our H2 server
var oldPref = prefs.getIntPref("network.http.speculative-parallel-limit");
prefs.setIntPref("network.http.speculative-parallel-limit", 0);
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", false);
prefs.setBoolPref("dom.push.enabled", true);
prefs.setBoolPref("dom.push.connection.enabled", true);
addCertOverride("localhost", serverPort,
Ci.nsICertOverrideService.ERROR_UNTRUSTED |
@ -81,4 +87,6 @@ add_task(function* test_pushUnsubscriptionSuccess() {
add_task(function* test_complete() {
prefs.setBoolPref("network.http.spdy.enforce-tls-profile", tlsProfile);
prefs.setBoolPref("dom.push.enabled", pushEnabled);
prefs.setBoolPref("dom.push.connection.enabled", pushConnectionEnabled);
});