Bug 1268077 - Fix up MockInstall AddonListener events. r=rhelmer, a=sledru
authorAndrew Swan <aswan@mozilla.com>
Thu, 02 Jun 2016 11:16:07 -0700
changeset 333474 ee02dda4aec7aa57a93cc61f8817ffcfa0139eac
parent 333473 c6c037a5f3bd3d37f840a7206f997b4702d5b3f5
child 333475 eacd3797afb7c4cea080a62274c3eb076fabe196
push id6120
push userryanvm@gmail.com
push dateMon, 27 Jun 2016 16:03:21 +0000
treeherdermozilla-beta@eacd3797afb7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrhelmer, sledru
bugs1268077
milestone48.0
Bug 1268077 - Fix up MockInstall AddonListener events. r=rhelmer, a=sledru MozReview-Commit-ID: JDStiM2GZIu
toolkit/mozapps/extensions/test/browser/head.js
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -1344,17 +1344,21 @@ MockInstall.prototype = {
       case AddonManager.STATE_DOWNLOADED:
         this.state = AddonManager.STATE_INSTALLING;
         if (!this.callListeners("onInstallStarted")) {
           this.state = AddonManager.STATE_CANCELLED;
           this.callListeners("onInstallCancelled");
           return;
         }
 
-        AddonManagerPrivate.callAddonListeners("onInstalling", this.addon);
+        let needsRestart = (this.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_INSTALL);
+        AddonManagerPrivate.callAddonListeners("onInstalling", this.addon, needsRestart);
+        if (!needsRestart) {
+          AddonManagerPrivate.callAddonListeners("onInstalled", this.addon);
+        }
 
         this.state = AddonManager.STATE_INSTALLED;
         this.callListeners("onInstallEnded");
         break;
       case AddonManager.STATE_DOWNLOADING:
       case AddonManager.STATE_CHECKING:
       case AddonManager.STATE_INSTALLING:
         // Installation is already running