diff --git a/dom/apps/Langpacks.jsm b/dom/apps/Langpacks.jsm index c3dfd4aa567..5c315b23fb1 100644 --- a/dom/apps/Langpacks.jsm +++ b/dom/apps/Langpacks.jsm @@ -18,11 +18,16 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm", this.EXPORTED_SYMBOLS = ["Langpacks"]; -let debug = Services.prefs.getBoolPref("dom.mozApps.debug") - ? (aMsg) => { - dump("-*-*- Langpacks: " + aMsg + "\n"); - } - : (aMsg) => {}; +let debug; +function debugPrefObserver() { + debug = Services.prefs.getBoolPref("dom.mozApps.debug") + ? (aMsg) => { + dump("-*-*- Langpacks: " + aMsg + "\n"); + } + : (aMsg) => {}; +} +debugPrefObserver(); +Services.prefs.addObserver("dom.mozApps.debug", debugPrefObserver, false); /** * Langpack support diff --git a/dom/apps/Webapps.jsm b/dom/apps/Webapps.jsm index bcfb26a1c45..d364a8a730b 100644 --- a/dom/apps/Webapps.jsm +++ b/dom/apps/Webapps.jsm @@ -107,10 +107,14 @@ let debug = Cu.import("resource://gre/modules/AndroidLog.jsm", {}) .AndroidLog.d.bind(null, "Webapps"); #else // Elsewhere, report debug messages only if dom.mozApps.debug is set to true. -// The pref is only checked once, on startup, so restart after changing it. -let debug = Services.prefs.getBoolPref("dom.mozApps.debug") - ? (aMsg) => dump("-*- Webapps.jsm : " + aMsg + "\n") - : (aMsg) => {}; +let debug; +function debugPrefObserver() { + debug = Services.prefs.getBoolPref("dom.mozApps.debug") + ? (aMsg) => dump("-*- Webapps.jsm : " + aMsg + "\n") + : (aMsg) => {}; +} +debugPrefObserver(); +Services.prefs.addObserver("dom.mozApps.debug", debugPrefObserver, false); #endif function getNSPRErrorCode(err) { diff --git a/dom/apps/tests/chrome.ini b/dom/apps/tests/chrome.ini index 14a8703318a..358cecd44ad 100644 --- a/dom/apps/tests/chrome.ini +++ b/dom/apps/tests/chrome.ini @@ -2,6 +2,7 @@ skip-if = buildapp == 'b2g' || os == 'android' support-files = asmjs/* + common.js file_bug_945152.html file_bug_945152.sjs diff --git a/dom/apps/tests/common.js b/dom/apps/tests/common.js new file mode 100644 index 00000000000..371073ede6b --- /dev/null +++ b/dom/apps/tests/common.js @@ -0,0 +1,3 @@ +function prepareEnv(cb) { + SpecialPowers.pushPrefEnv({"set":[["dom.mozApps.debug", true]]}, cb); +} diff --git a/dom/apps/tests/mochitest.ini b/dom/apps/tests/mochitest.ini index b7cf5aa29a0..e45722b677f 100644 --- a/dom/apps/tests/mochitest.ini +++ b/dom/apps/tests/mochitest.ini @@ -8,6 +8,7 @@ support-files = addons/update.webapp^headers^ addons/index.html chromeAddCert.js + common.js file_app.sjs file_app.template.html file_script.template.js diff --git a/dom/apps/tests/test_app_addons.html b/dom/apps/tests/test_app_addons.html index b930459805d..da5cf72bb23 100644 --- a/dom/apps/tests/test_app_addons.html +++ b/dom/apps/tests/test_app_addons.html @@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1042881 Test for Bug 923897 - Test apps as addons + - +

diff --git a/dom/apps/tests/test_app_enabled.html b/dom/apps/tests/test_app_enabled.html index 4ed48fc09cd..3e82f2c6a95 100644 --- a/dom/apps/tests/test_app_enabled.html +++ b/dom/apps/tests/test_app_enabled.html @@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id={1XXXXXX} Test for Bug {1072090} + @@ -121,7 +122,7 @@ function runTest() { is(request.result.length, initialAppsCount, "All apps are uninstalled."); } -addLoadEvent(go); +addLoadEvent(() => prepareEnv(go)); diff --git a/dom/apps/tests/test_app_update.html b/dom/apps/tests/test_app_update.html index cdff6856df7..55421b2cd7d 100644 --- a/dom/apps/tests/test_app_update.html +++ b/dom/apps/tests/test_app_update.html @@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=826058 Test for Bug 826058 + - + Mozilla Bug 826058 Mozilla Bug 863337

diff --git a/dom/apps/tests/test_bug_1168300.html b/dom/apps/tests/test_bug_1168300.html index ea7c2443fdf..eb79b112154 100644 --- a/dom/apps/tests/test_bug_1168300.html +++ b/dom/apps/tests/test_bug_1168300.html @@ -7,6 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1168300 Test for Bug 1168300 + - + Mozilla Bug 1168300