Bug 1081343 followup: skip the tests for non-Nightly builds, and ifdef more of nsBrowserGlue.js/firefox.js

--HG--
extra : rebase_source : c2d3000538246ad6c892cd8cf7934ab55583a9d3
This commit is contained in:
Gavin Sharp 2014-10-28 09:55:14 -07:00
parent 9b458a01cd
commit 62e22298de
3 changed files with 20 additions and 0 deletions

View File

@ -1764,8 +1764,10 @@ pref("media.gmp-gmpopenh264.provider.enabled", true);
pref("browser.apps.URL", "https://marketplace.firefox.com/discovery/");
#ifdef NIGHTLY_BUILD
pref("browser.polaris.enabled", false);
pref("privacy.trackingprotection.ui.enabled", false);
#endif
// Temporary pref to allow printing in e10s windows on some platforms.
#ifdef UNIX_BUT_NOT_MAC

View File

@ -401,6 +401,7 @@ BrowserGlue.prototype = {
Services.obs.removeObserver(this, "browser-search-service");
this._syncSearchEngines();
break;
#ifdef NIGHTLY_BUILD
case "nsPref:changed":
if (data == POLARIS_ENABLED) {
let enabled = Services.prefs.getBoolPref(POLARIS_ENABLED);
@ -408,6 +409,7 @@ BrowserGlue.prototype = {
Services.prefs.setBoolPref("privacy.trackingprotection.enabled", enabled);
Services.prefs.setBoolPref("privacy.trackingprotection.ui.enabled", enabled);
}
#endif
}
},

View File

@ -23,12 +23,24 @@ function* testPrefs(test) {
}
}
function isNightly() {
return Services.appinfo.version.contains("a1");
}
add_task(function* test_default_values() {
if (!isNightly()) {
ok(true, "Skipping test, not Nightly")
return;
}
Assert.ok(!Services.prefs.getBoolPref(POLARIS_ENABLED), POLARIS_ENABLED + " is disabled by default.");
Assert.ok(!Services.prefs.getBoolPref(PREF_TPUI), PREF_TPUI + "is disabled by default.");
});
add_task(function* test_changing_pref_changes_tracking() {
if (!isNightly()) {
ok(true, "Skipping test, not Nightly")
return;
}
function* testPref(pref) {
Services.prefs.setBoolPref(POLARIS_ENABLED, true);
yield assertPref(pref, true);
@ -41,6 +53,10 @@ add_task(function* test_changing_pref_changes_tracking() {
});
add_task(function* test_prefs_can_be_changed_individually() {
if (!isNightly()) {
ok(true, "Skipping test, not Nightly")
return;
}
function* testPref(pref) {
Services.prefs.setBoolPref(POLARIS_ENABLED, true);
yield assertPref(pref, true);