Bug 1432894 - Rely on MarionetteMainProcess#enabled instead of pref. r?whimboo
The MarionetteMainProcess#enabled getter returns the value of the
preference so it is more appropriate to use the correct API than
to fetch the preference directly.
MozReview-Commit-ID: 16rpk7rrves
--- a/testing/marionette/components/marionette.js
+++ b/testing/marionette/components/marionette.js
@@ -409,17 +409,17 @@ class MarionetteMainProcess {
}
}
observe(subject, topic) {
log.debug(`Received observer notification ${topic}`);
switch (topic) {
case "nsPref:changed":
- if (Services.prefs.getBoolPref(PREF_ENABLED)) {
+ if (this.enabled) {
this.init();
} else {
this.uninit();
}
break;
case "profile-after-change":
Services.obs.addObserver(this, "command-line-startup");