Bug 1311739 - Silence `serverURL` pref warnings in push tests. r?dragana
MozReview-Commit-ID: 9Peorbb5pFS
--- a/dom/push/PushService.jsm
+++ b/dom/push/PushService.jsm
@@ -487,29 +487,28 @@ this.PushService = {
console.debug("init()");
if (this._state > PUSH_SERVICE_UNINIT) {
return;
}
this._setState(PUSH_SERVICE_ACTIVATING);
+ prefs.observe("serverURL", this);
Services.obs.addObserver(this, "quit-application", false);
if (options.serverURI) {
// this is use for xpcshell test.
this._stateChangeProcessEnqueue(_ =>
this._changeServerURL(options.serverURI, STARTING_SERVICE_EVENT, options));
} else {
// This is only used for testing. Different tests require connecting to
// slightly different URLs.
- prefs.observe("serverURL", this);
-
this._stateChangeProcessEnqueue(_ =>
this._changeServerURL(prefs.get("serverURL"), STARTING_SERVICE_EVENT));
}
},
_startObservers: function() {
console.debug("startObservers()");