Bug 1432894 - Rely on MarionetteMainProcess#enabled instead of pref. r?whimboo draft
authorAndreas Tolfsen <ato@sny.no>
Sat, 14 Apr 2018 16:02:42 +0100
changeset 786293 02bab59835748eac87a6bbd7b481b19ba861a069
parent 786292 f6cc199bb6ba6385d8f86033db55d609f84d7549
child 786294 df3ec52c41f12386774f75179c3d251348be7f5c
child 786296 bddd2c688494b01d57dfc7d85a097030a690b64f
child 786298 5296cf655d378fc33176e9c420bbe5b9924558a6
push id107427
push userbmo:ato@sny.no
push dateSun, 22 Apr 2018 15:48:49 +0000
reviewerswhimboo
bugs1432894
milestone61.0a1
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
testing/marionette/components/marionette.js
--- 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");