Bug 1503859 - Remove icon64URL addon property. r=aswan
authorOriol Brufau <oriol-bugzilla@hotmail.com>
Thu, 01 Nov 2018 22:55:03 +0000
changeset 444043 3cd897973666ce779e9ec56b4679ad9052461376
parent 444042 2b6677a1d32dc5fe02603ee3062cf335bb938d8d
child 444044 b66d9bef7ba21ca158122544f68e6db752a95506
push id109501
push userccoroiu@mozilla.com
push dateFri, 02 Nov 2018 05:19:20 +0000
treeherdermozilla-inbound@2be891b25f69 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1503859
milestone65.0a1
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
Bug 1503859 - Remove icon64URL addon property. r=aswan Differential Revision: https://phabricator.services.mozilla.com/D10555
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
toolkit/mozapps/extensions/internal/RDFManifestConverter.jsm
toolkit/mozapps/extensions/internal/XPIDatabase.jsm
toolkit/mozapps/extensions/internal/XPIInstall.jsm
toolkit/mozapps/extensions/test/browser/browser_details.js
toolkit/mozapps/extensions/test/xpcshell/test_install.js
toolkit/mozapps/extensions/test/xpcshell/test_manifest.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
toolkit/mozapps/extensions/test/xpcshell/test_webextension_icons.js
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -2074,19 +2074,18 @@ var AddonManagerInternal = {
    *
    * The optional window parameter will be used to determine
    * the screen resolution and select a more appropriate icon.
    * Calling this method with 48px on retina screens will try to
    * match an icon of size 96px.
    *
    * @param  aAddon
    *         An addon object, meaning:
-   *         An object with either an icons property that is a key-value
-   *         list of icon size and icon URL, or an object having an iconURL
-   *         and icon64URL property.
+   *         An object with either an icons property that is a key-value list
+   *         of icon size and icon URL, or an object having an iconURL property.
    * @param  aSize
    *         Ideal icon size in pixels
    * @param  aWindow
    *         Optional window object for determining the correct scale.
    * @return {String} The absolute URL of the icon or null if the addon doesn't have icons
    */
   getPreferredIconURL(aAddon, aSize, aWindow = undefined) {
     if (aWindow && aWindow.devicePixelRatio) {
@@ -2097,19 +2096,16 @@ var AddonManagerInternal = {
 
     // certain addon-types only have iconURLs
     if (!icons) {
       icons = {};
       if (aAddon.iconURL) {
         icons[32] = aAddon.iconURL;
         icons[48] = aAddon.iconURL;
       }
-      if (aAddon.icon64URL) {
-        icons[64] = aAddon.icon64URL;
-      }
     }
 
     // quick return if the exact size was found
     if (icons[aSize]) {
       return icons[aSize];
     }
 
     let bestSize = null;
--- a/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
+++ b/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm
@@ -953,17 +953,17 @@ var AddonTestUtils = {
     rdf += '<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n' +
            '     xmlns:em="http://www.mozilla.org/2004/em-rdf#">\n';
 
     rdf += '<Description about="urn:mozilla:install-manifest">\n';
 
     data = Object.assign({}, defaults, data);
 
     let props = ["id", "version", "type", "internalName", "updateURL",
-                 "optionsURL", "optionsType", "aboutURL", "iconURL", "icon64URL",
+                 "optionsURL", "optionsType", "aboutURL", "iconURL",
                  "skinnable", "bootstrap", "strictCompatibility",
                  "hasEmbeddedWebExtension"];
     rdf += this._writeProps(data, props);
 
     rdf += this._writeLocaleStrings(data);
 
     for (let platform of data.targetPlatforms || [])
       rdf += escaped`<em:targetPlatform>${platform}</em:targetPlatform>\n`;
--- a/toolkit/mozapps/extensions/internal/RDFManifestConverter.jsm
+++ b/toolkit/mozapps/extensions/internal/RDFManifestConverter.jsm
@@ -86,17 +86,17 @@ class InstallRDF extends Manifest {
     });
   }
 
   decode() {
     let root = this.ds.getResource(RDFURI_INSTALL_MANIFEST_ROOT);
     let result = {};
 
     let props = ["id", "version", "type", "updateURL", "optionsURL",
-                 "optionsType", "aboutURL", "iconURL", "icon64URL",
+                 "optionsType", "aboutURL", "iconURL",
                  "bootstrap", "unpack", "strictCompatibility",
                  "hasEmbeddedWebExtension"];
     this._readProps(root, result, props);
 
     let decodeTargetApplication = source => {
       let app = {};
       this._readProps(source, app, ["id", "minVersion", "maxVersion"]);
       return app;
--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm
@@ -110,17 +110,17 @@ const PROP_JSON_FIELDS = ["id", "syncGUI
                           "defaultLocale", "visible", "active", "userDisabled",
                           "appDisabled", "pendingUninstall", "installDate",
                           "updateDate", "applyBackgroundUpdates", "path",
                           "skinnable", "sourceURI", "releaseNotesURI",
                           "softDisabled", "foreignInstall",
                           "strictCompatibility", "locales", "targetApplications",
                           "targetPlatforms", "signedState",
                           "seen", "dependencies", "hasEmbeddedWebExtension",
-                          "userPermissions", "icons", "iconURL", "icon64URL",
+                          "userPermissions", "icons", "iconURL",
                           "blocklistState", "blocklistURL", "startupData",
                           "previewImage", "hidden", "installTelemetryInfo"];
 
 const LEGACY_TYPES = new Set([
   "extension",
 ]);
 
 // Some add-on types that we track internally are presented as other types
@@ -802,20 +802,16 @@ AddonWrapper = class {
   async getBlocklistURL() {
     return addonFor(this).blocklistURL;
   }
 
   get iconURL() {
     return AddonManager.getPreferredIconURL(this, 48);
   }
 
-  get icon64URL() {
-    return AddonManager.getPreferredIconURL(this, 64);
-  }
-
   get icons() {
     let addon = addonFor(this);
     let icons = {};
 
     if (addon._repositoryAddon) {
       for (let size in addon._repositoryAddon.icons) {
         icons[size] = addon._repositoryAddon.icons[size];
       }
@@ -828,20 +824,16 @@ AddonWrapper = class {
     }
 
     let canUseIconURLs = this.isActive;
     if (canUseIconURLs && addon.iconURL) {
       icons[32] = addon.iconURL;
       icons[48] = addon.iconURL;
     }
 
-    if (canUseIconURLs && addon.icon64URL) {
-      icons[64] = addon.icon64URL;
-    }
-
     Object.freeze(icons);
     return icons;
   }
 
   get screenshots() {
     let addon = addonFor(this);
     let repositoryAddon = addon._repositoryAddon;
     if (repositoryAddon && ("screenshots" in repositoryAddon)) {
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -159,18 +159,17 @@ const KEY_TEMPDIR                     = 
 
 const KEY_APP_PROFILE                 = "app-profile";
 
 const DIR_STAGE                       = "staged";
 const DIR_TRASH                       = "trash";
 
 // Properties that exist in the install manifest
 const PROP_METADATA      = ["id", "version", "type", "internalName", "updateURL",
-                            "optionsURL", "optionsType", "aboutURL",
-                            "iconURL", "icon64URL"];
+                            "optionsURL", "optionsType", "aboutURL", "iconURL"];
 const PROP_LOCALE_SINGLE = ["name", "description", "creator", "homepageURL"];
 const PROP_LOCALE_MULTI  = ["developers", "translators", "contributors"];
 
 // Map new string type identifiers to old style nsIUpdateItem types.
 // Retired values:
 // 32 = multipackage xpi file
 // 8 = locale
 // 256 = apiextension
@@ -481,17 +480,16 @@ async function loadManifestFromWebManife
     else
       addon.optionsType = AddonManager.OPTIONS_TYPE_INLINE_BROWSER;
 
     addon.optionsBrowserStyle = manifest.options_ui.browser_style;
   }
 
   // WebExtensions don't use iconURLs
   addon.iconURL = null;
-  addon.icon64URL = null;
   addon.icons = manifest.icons || {};
   addon.userPermissions = extension.manifestPermissions;
 
   addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DEFAULT;
 
   function getLocale(aLocale) {
     // Use the raw manifest, here, since we need values with their
     // localization placeholders still in place.
--- a/toolkit/mozapps/extensions/test/browser/browser_details.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_details.js
@@ -50,17 +50,16 @@ async function test() {
   gProvider.createAddons([{
     id: "addon1@tests.mozilla.org",
     name: "Test add-on 1",
     version: "2.1",
     description: "Short description",
     fullDescription: "Longer description",
     type: "extension",
     iconURL: "chrome://foo/skin/icon.png",
-    icon64URL: "chrome://foo/skin/icon64.png",
     contributionURL: "http://foo.com",
     contributionAmount: "$0.99",
     sourceURI: Services.io.newURI("http://example.com/foo"),
     averageRating: 4,
     reviewCount: 5,
     reviewURL: "http://example.com/reviews",
     homepageURL: "http://example.com/addon1",
     applyBackgroundUpdates: AddonManager.AUTOUPDATE_ENABLE,
@@ -509,17 +508,16 @@ add_test(function() {
     gProvider.createAddons([{
       id: "addon1@tests.mozilla.org",
       name: "Test add-on replacement",
       version: "2.5",
       description: "Short description replacement",
       fullDescription: "Longer description replacement",
       type: "extension",
       iconURL: "chrome://foo/skin/icon.png",
-      icon64URL: "chrome://foo/skin/icon264.png",
       sourceURI: Services.io.newURI("http://example.com/foo"),
       averageRating: 2,
       optionsURL: "chrome://foo/content/options.xul",
       applyBackgroundUpdates: AddonManager.AUTOUPDATE_ENABLE,
       operationsRequiringRestart: AddonManager.OP_NEEDS_RESTART_NONE,
     }]);
 
     is(get("detail-name").textContent, "Test add-on replacement", "Name should be correct");
--- a/toolkit/mozapps/extensions/test/xpcshell/test_install.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_install.js
@@ -129,17 +129,16 @@ add_task(async function test_1() {
     iconURL: null,
     sourceURI: uri,
   });
 
   let {addon} = install;
   checkAddon("addon1@tests.mozilla.org", addon, {
     install,
     iconURL: `jar:${uri.spec}!/icon.png`,
-    icon64URL: `jar:${uri.spec}!/icon64.png`,
     sourceURI: uri,
   });
   notEqual(addon.syncGUID, null);
   equal(addon.getResourceURI("install.rdf").spec, `jar:${uri.spec}!/install.rdf`);
 
   let activeInstalls = await AddonManager.getAllInstalls();
   equal(activeInstalls.length, 1);
   equal(activeInstalls[0], install);
@@ -200,17 +199,16 @@ add_task(async function test_1() {
 
   checkAddon("addon1@tests.mozilla.org", a1, {
     syncGUID: installSyncGUID,
     type: "extension",
     version: "1.0",
     name: "Test 1",
     foreignInstall: false,
     iconURL: uri2 + "icon.png",
-    icon64URL: uri2 + "icon64.png",
     sourceURI: Services.io.newFileURI(XPIS.test_install1),
   });
 
   notEqual(a1.syncGUID, null);
   ok(a1.syncGUID.length >= 9);
 
   ok(isExtensionInBootstrappedList(profileDir, a1.id));
   ok(XPIS.test_install1.exists());
--- a/toolkit/mozapps/extensions/test/xpcshell/test_manifest.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_manifest.js
@@ -9,17 +9,16 @@
 const ADDONS = [
   {
     "install.rdf": {
       id: "addon1@tests.mozilla.org",
       version: "1.0",
       bootstrap: true,
       aboutURL: "chrome://test/content/about.xul",
       iconURL: "chrome://test/skin/icon.png",
-      icon64URL: "chrome://test/skin/icon64.png",
       targetApplications: [{
         id: "xpcshell@tests.mozilla.org",
         minVersion: "1",
         maxVersion: "1",
       }],
       name: "Test Addon 1",
       description: "Test Description",
       creator: "Test Creator",
@@ -40,18 +39,17 @@ const ADDONS = [
 
     expected: {
       id: "addon1@tests.mozilla.org",
       type: "extension",
       version: "1.0",
       optionsType: null,
       aboutURL: "chrome://test/content/about.xul",
       iconURL: "chrome://test/skin/icon.png",
-      icon64URL: "chrome://test/skin/icon64.png",
-      icons: {32: "chrome://test/skin/icon.png", 48: "chrome://test/skin/icon.png", 64: "chrome://test/skin/icon64.png"},
+      icons: {32: "chrome://test/skin/icon.png", 48: "chrome://test/skin/icon.png"},
       name: "Test Addon 1",
       description: "Test Description",
       creator: "Test Creator",
       homepageURL: "http://www.example.com",
       developers: ["Test Developer 1", "Test Developer 2"],
       translators: ["Test Translator 1", "Test Translator 2"],
       contributors: ["Test Contributor 1", "Test Contributor 2"],
       isActive: true,
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
@@ -90,17 +90,16 @@ add_task(async function test_1() {
     isCompatible: true,
     appDisabled: false,
     isActive: true,
     isSystem: false,
     type: "extension",
     isWebExtension: true,
     signedState: AddonManager.SIGNEDSTATE_PRIVILEGED,
     iconURL: `${uri}icon48.png`,
-    icon64URL: `${uri}icon64.png`,
   });
 
   // Should persist through a restart
   await promiseShutdownManager();
 
   equal(GlobalManager.extensionMap.size, 0);
 
   await promiseStartupManager();
@@ -117,17 +116,16 @@ add_task(async function test_1() {
     name: "Web Extension Name",
     isCompatible: true,
     appDisabled: false,
     isActive: true,
     isSystem: false,
     type: "extension",
     signedState: AddonManager.SIGNEDSTATE_PRIVILEGED,
     iconURL: `${uri}icon48.png`,
-    icon64URL: `${uri}icon64.png`,
   });
 
   await addon.disable();
 
   equal(GlobalManager.extensionMap.size, 0);
 
   await addon.enable();
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension_icons.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension_icons.js
@@ -23,19 +23,18 @@ async function testSimpleIconsetParsing(
   function check_icons(addon_copy) {
     deepEqual(addon_copy.icons, {
         16: uri + "icon16.png",
         32: uri + "icon32.png",
         48: uri + "icon48.png",
         64: uri + "icon64.png",
     });
 
-    // iconURL should map to icons[48] and icons[64]
+    // iconURL should map to icons[48]
     equal(addon.iconURL, uri + "icon48.png");
-    equal(addon.icon64URL, uri + "icon64.png");
 
     // AddonManager gets the correct icon sizes from addon.icons
     equal(AddonManager.getPreferredIconURL(addon, 1), uri + "icon16.png");
     equal(AddonManager.getPreferredIconURL(addon, 16), uri + "icon16.png");
     equal(AddonManager.getPreferredIconURL(addon, 30), uri + "icon32.png");
     equal(AddonManager.getPreferredIconURL(addon, 48), uri + "icon48.png");
     equal(AddonManager.getPreferredIconURL(addon, 64), uri + "icon64.png");
     equal(AddonManager.getPreferredIconURL(addon, 128), uri + "icon64.png");
@@ -86,17 +85,16 @@ async function testNoIconsParsing(manife
   await promiseRestartManager();
 
   let addon = await promiseAddonByID(ID);
   Assert.notEqual(addon, null);
 
   deepEqual(addon.icons, {});
 
   equal(addon.iconURL, null);
-  equal(addon.icon64URL, null);
 
   equal(AddonManager.getPreferredIconURL(addon, 128), null);
 
   await addon.uninstall();
 }
 
 // Test simple icon set parsing
 add_task(async function() {