Backed out changeset 4c66ae0b0b91 (bug 1218266) for xpcshell bustage in test_api.js a=backout
authorWes Kocher <wkocher@mozilla.com>
Mon, 04 Jan 2016 13:53:47 -0800
changeset 304180 57f85790732edeff1890c3c56a02b3ae049885ba
parent 304179 ec2b2ab4e57d328b63e4857f74f2311db7ad6c4f
child 304181 926afd40eb759774b521f30ec1e407ee60e7c4cd
child 304183 3a9a2082844e2ee5ac9c7b870c019b49a95ac808
child 304184 9ebad515bc39afdea1e656bf15218a0511a5d1e2
push id5455
push userkwierso@gmail.com
push dateMon, 04 Jan 2016 21:53:54 +0000
treeherdermozilla-beta@57f85790732e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1218266
milestone44.0
backs out4c66ae0b0b91d82bf13b518f37c8c0c0c88bd141
Backed out changeset 4c66ae0b0b91 (bug 1218266) for xpcshell bustage in test_api.js a=backout
browser/experiments/Experiments.jsm
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -1935,58 +1935,37 @@ Experiments.ExperimentEntry.prototype = 
                       "enabled.");
     }
 
     // If we have the add-on and it is enabled, we are done.
     if (!addon.userDisabled) {
       return changes;
     }
 
-    // Check permissions to see if we can enable the addon.
-    if (!(addon.permissions & AddonManager.PERM_CAN_ENABLE)) {
-      throw new Error("Don't have permission to enable addon " + addon.id + ", perm=" + addon.permission);
-    }
-
-    // Experiment addons should not require a restart.
-    if (!!(addon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE)) {
-      throw new Error("Experiment addon requires a restart: " + addon.id);
-    }
-
     let deferred = Promise.defer();
 
     // Else we need to enable it.
     let listener = {
       onEnabled: enabledAddon => {
         if (enabledAddon.id != addon.id) {
           return;
         }
 
         AddonManager.removeAddonListener(listener);
         deferred.resolve();
       },
     };
 
-    for (let handler of ["onDisabled", "onOperationCancelled", "onUninstalled"]) {
-      listener[handler] = (evtAddon) => {
-        if (evtAddon.id != addon.id) {
-          return;
-        }
-
-        AddonManager.removeAddonListener(listener);
-        deferred.reject("Failed to enable addon " + addon.id + " due to: " + handler);
-      };
-    }
-
-    this._log.info("reconcileAddonState() - Activating add-on: " + addon.id);
+    this._log.info("Activating add-on: " + addon.id);
     AddonManager.addAddonListener(listener);
     addon.userDisabled = false;
     yield deferred.promise;
     changes |= this.ADDON_CHANGE_ENABLE;
 
-    this._log.info("reconcileAddonState() - Add-on has been enabled: " + addon.id);
+    this._log.info("Add-on has been enabled: " + addon.id);
     return changes;
    }),
 
   /**
    * Obtain the underlying Addon from the Addon Manager.
    *
    * @return Promise<Addon|null>
    */