Backed out changeset d8191c9b20ca (bug 1308295) for failing browser-chrome tests browser_bug567127.js, browser_discovery_install.js and browser_getmorethemes.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 10 Jan 2017 17:57:38 +0100
changeset 328815 d2eccdc4a23256d51d2e32986a59b6ffadbafa19
parent 328814 1a7e3e649e7bbeba69c95b0f7ab67480e70d2948
child 328816 850ff3e591469b48f4d7f7a06acc9d63738c1840
push id85546
push userkwierso@gmail.com
push dateWed, 11 Jan 2017 02:36:30 +0000
treeherdermozilla-inbound@c5bce4cd684a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1308295, 567127
milestone53.0a1
backs outd8191c9b20cad8902a7b99935043f9ae88ab0f6a
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset d8191c9b20ca (bug 1308295) for failing browser-chrome tests browser_bug567127.js, browser_discovery_install.js and browser_getmorethemes.js. r=backout
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -3011,17 +3011,17 @@ var AddonManagerInternal = {
         checkInstallUrl(options.url);
       } catch (err) {
         return Promise.reject({message: err.message});
       }
 
       return AddonManagerInternal.getInstallForURL(options.url, "application/x-xpinstall",
                                                    options.hash).then(install => {
         if (Preferences.get(PREF_WEBEXT_PREF_PROMPTS, false)) {
-          install.promptHandler = info => new Promise((resolve, reject) => {
+          install._permHandler = info => new Promise((resolve, reject) => {
             const observer = {
               observe(subject, topic, data) {
                 if (topic == "webextension-permission-response" &&
                     subject.wrappedJSObject.info.addon == info.addon) {
                   let answer = JSON.parse(data);
                   Services.obs.removeObserver(this, "webextension-permission-response");
                   if (answer) {
                     resolve();
@@ -3303,20 +3303,20 @@ this.AddonManager = {
     // The install is being downloaded.
     ["STATE_DOWNLOADING",  1],
     // The install is checking for compatibility information.
     ["STATE_CHECKING", 2],
     // The install is downloaded and ready to install.
     ["STATE_DOWNLOADED", 3],
     // The download failed.
     ["STATE_DOWNLOAD_FAILED", 4],
-    // The install may not proceed until the user accepts a prompt
-    ["STATE_AWAITING_PROMPT", 5],
-    // Any prompts are done
-    ["STATE_PROMPTS_DONE", 6],
+    // The install may not proceed until the user accepts permissions
+    ["STATE_AWAITING_PERMISSIONS", 5],
+    // Any permission prompts are done
+    ["STATE_PERMISSION_GRANTED", 6],
     // The install has been postponed.
     ["STATE_POSTPONED", 7],
     // The install is ready to be applied.
     ["STATE_READY", 8],
     // The add-on is being installed.
     ["STATE_INSTALLING", 9],
     // The add-on has been installed.
     ["STATE_INSTALLED", 10],
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -5290,34 +5290,34 @@ class AddonInstall {
    * @param  options.name
    *         An optional name for the add-on
    * @param  options.type
    *         An optional type for the add-on
    * @param  options.icons
    *         Optional icons for the add-on
    * @param  options.version
    *         An optional version for the add-on
-   * @param  options.promptHandler
-   *         A callback to prompt the user before installing.
+   * @param  options.permHandler
+   *         A callback to present permissions to the user before installing.
    */
   constructor(installLocation, url, options = {}) {
     this.wrapper = new AddonInstallWrapper(this);
     this.installLocation = installLocation;
     this.sourceURI = url;
 
     if (options.hash) {
       let hashSplit = options.hash.toLowerCase().split(":");
       this.originalHash = {
         algorithm: hashSplit[0],
         data: hashSplit[1]
       };
     }
     this.hash = this.originalHash;
     this.existingAddon = options.existingAddon || null;
-    this.promptHandler = options.promptHandler || (() => Promise.resolve());
+    this.permHandler = options.permHandler || (() => Promise.resolve());
     this.releaseNotesURI = null;
 
     this.listeners = [];
     this.icons = options.icons || {};
     this.error = 0;
 
     this.progress = 0;
     this.maxProgress = -1;
@@ -5347,19 +5347,19 @@ class AddonInstall {
    * Note this method is overridden to handle additional state in
    * the subclassses below.
    *
    * @throws if installation cannot proceed from the current state
    */
   install() {
     switch (this.state) {
     case AddonManager.STATE_DOWNLOADED:
-      this.checkPrompt();
+      this.checkPermissions();
       break;
-    case AddonManager.STATE_PROMPTS_DONE:
+    case AddonManager.STATE_PERMISSION_GRANTED:
       this.checkForBlockers();
       break;
     case AddonManager.STATE_READY:
       this.startInstall();
       break;
     case AddonManager.STATE_POSTPONED:
       logger.debug(`Postponing install of ${this.addon.id}`);
       break;
@@ -5615,37 +5615,37 @@ class AddonInstall {
 
   /**
    * This method should be called when the XPI is ready to be installed,
    * i.e., when a download finishes or when a local file has been verified.
    * It should only be called from install() when the install is in
    * STATE_DOWNLOADED (which actually means that the file is available
    * and has been verified).
    */
-  checkPrompt() {
+  checkPermissions() {
     Task.spawn((function*() {
-      if (this.promptHandler) {
+      if (this.permHandler) {
         let info = {
           existingAddon: this.existingAddon ? this.existingAddon.wrapper : null,
           addon: this.addon.wrapper,
           icon: this.getIcon(),
         };
 
         try {
-          yield this.promptHandler(info);
+          yield this.permHandler(info);
         } catch (err) {
-          logger.info(`Install of ${this.addon.id} cancelled by user`);
+          logger.info(`Install of ${this.addon.id} cancelled since user declined permissions`);
           this.state = AddonManager.STATE_CANCELLED;
           XPIProvider.removeActiveInstall(this);
           AddonManagerPrivate.callInstallListeners("onInstallCancelled",
                                                    this.listeners, this.wrapper);
           return;
         }
       }
-      this.state = AddonManager.STATE_PROMPTS_DONE;
+      this.state = AddonManager.STATE_PERMISSION_GRANTED;
       this.install();
     }).bind(this));
   }
 
   /**
    * This method should be called when we have the XPI and any needed
    * permissions prompts have been completed.  If there are any upgrade
    * listeners, they are invoked and the install moves into STATE_POSTPONED.
@@ -6087,18 +6087,18 @@ class DownloadAddonInstall extends Addon
    * @param  options.name
    *         An optional name for the add-on
    * @param  options.type
    *         An optional type for the add-on
    * @param  options.icons
    *         Optional icons for the add-on
    * @param  options.version
    *         An optional version for the add-on
-   * @param  options.promptHandler
-   *         A callback to prompt the user before installing.
+   * @param  options.permHandler
+   *         A callback to present permissions to the user before installing.
    */
   constructor(installLocation, url, options = {}) {
     super(installLocation, url, options);
 
     this.browser = options.browser;
 
     this.state = AddonManager.STATE_AVAILABLE;
 
@@ -6603,18 +6603,18 @@ AddonInstallWrapper.prototype = {
     let install = installFor(this);
     return install.addon ? install.addon.wrapper : null;
   },
 
   get sourceURI() {
     return installFor(this).sourceURI;
   },
 
-  set promptHandler(handler) {
-    installFor(this).promptHandler = handler;
+  set _permHandler(handler) {
+    installFor(this).permHandler = handler;
   },
 
   install() {
     installFor(this).install();
   },
 
   cancel() {
     installFor(this).cancel();
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_install.js
@@ -487,17 +487,17 @@ add_task(function* test_permissions() {
     permissions: ["tabs", "storage", "https://*.example.com/*", "<all_urls>", "experiments.test"],
   };
 
   let xpi = ExtensionTestCommon.generateXPI({manifest});
 
   let install = yield AddonManager.getInstallForFile(xpi);
 
   let perminfo;
-  install.promptHandler = info => {
+  install._permHandler = info => {
     perminfo = info;
     return Promise.resolve();
   };
 
   yield promiseCompleteInstall(install);
 
   notEqual(perminfo, undefined, "Permission handler was invoked");
   equal(perminfo.existingAddon, null, "Permission info does not include an existing addon");
@@ -525,17 +525,17 @@ add_task(function* test_permissions() {
     permissions: ["webRequestBlocking"],
   };
 
   let xpi = ExtensionTestCommon.generateXPI({manifest});
 
   let install = yield AddonManager.getInstallForFile(xpi);
 
   let perminfo;
-  install.promptHandler = info => {
+  install._permHandler = info => {
     perminfo = info;
     return Promise.reject();
   };
 
   yield promiseCompleteInstall(install);
 
   notEqual(perminfo, undefined, "Permission handler was invoked");