Backed out changeset d0ba9997681a (bug 1283116) for android xpcshell failures a=backout
authorWes Kocher <wkocher@mozilla.com>
Wed, 17 Aug 2016 16:00:47 -0700
changeset 310103 1c5c2183b9211aa1a8a05e23ef85592527c92725
parent 310102 cad914b2d68bc04e3820eb90f5aee76feb92d320
child 310104 535bd44df96a10dba1cd0d7a6743c46d104f9f11
push id80771
push userkwierso@gmail.com
push dateThu, 18 Aug 2016 23:33:08 +0000
treeherdermozilla-inbound@cb1295738c37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1283116
milestone51.0a1
backs outd0ba9997681a36d6772b809e87077718eafff1f4
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 d0ba9997681a (bug 1283116) for android xpcshell failures a=backout
toolkit/components/extensions/ext-management.js
toolkit/components/extensions/schemas/management.json
toolkit/mozapps/extensions/test/xpcshell/test_ext_management.js
toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
--- a/toolkit/components/extensions/ext-management.js
+++ b/toolkit/components/extensions/ext-management.js
@@ -1,61 +1,9 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
-                                  "resource://gre/modules/AddonManager.jsm");
-
-function installType(addon) {
-  if (addon.temporarilyInstalled) {
-    return "development";
-  } else if (addon.foreignInstall) {
-    return "sideload";
-  } else if (addon.isSystem) {
-    return "other";
-  }
-  return "normal";
-}
-
 extensions.registerSchemaAPI("management", (extension, context) => {
   return {
-    management: {
-      getSelf: function() {
-        return new Promise((resolve, reject) => AddonManager.getAddonByID(extension.id, addon => {
-          try {
-            let m = extension.manifest;
-            let extInfo = {
-              id: extension.id,
-              name: addon.name,
-              shortName: m.short_name || "",
-              description: addon.description || "",
-              version: addon.version,
-              mayDisable: !!(addon.permissions & AddonManager.PERM_CAN_DISABLE),
-              enabled: addon.isActive,
-              optionsUrl: addon.optionsURL || "",
-              permissions: Array.from(extension.permissions).filter(perm => {
-                return !extension.whiteListedHosts.pat.includes(perm);
-              }),
-              hostPermissions: extension.whiteListedHosts.pat,
-              installType: installType(addon),
-            };
-            if (addon.homepageURL) {
-              extInfo.homepageUrl = addon.homepageURL;
-            }
-            if (addon.updateURL) {
-              extInfo.updateUrl = addon.updateURL;
-            }
-            if (m.icons) {
-              extInfo.icons = Object.keys(m.icons).map(key => {
-                return {size: Number(key), url: m.icons[key]};
-              });
-            }
-
-            resolve(extInfo);
-          } catch (e) {
-            reject(e);
-          }
-        }));
-      },
-    },
+    management: {},
   };
 });
--- a/toolkit/components/extensions/schemas/management.json
+++ b/toolkit/components/extensions/schemas/management.json
@@ -193,16 +193,17 @@
               }
             ]
           }
         ]
       },
       {
         "name": "getSelf",
         "type": "function",
+        "unsupported": true,
         "description": "Returns information about the calling extension. Note: This function can be used without requesting the 'management' permission in the manifest.",
         "async": "callback",
         "parameters": [
           {
             "type": "function",
             "name": "callback",
             "optional": true,
             "parameters": [
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_ext_management.js
+++ /dev/null
@@ -1,137 +0,0 @@
-"use strict";
-
-add_task(function* setup() {
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "48", "48");
-  startupManager();
-});
-
-/* eslint-disable no-undef */
-// Shared background function for getSelf tests
-function backgroundGetSelf() {
-  browser.management.getSelf().then(extInfo => {
-    browser.test.sendMessage("management-getSelf", extInfo);
-  }, error => {
-    browser.test.notifyFail(`getSelf rejected with error: ${error}`);
-  });
-}
-/* eslint-enable no-undef */
-
-add_task(function* test_management_get_self_complete() {
-  const id = "get_self_test_complete@tests.mozilla.com";
-  const permissions = ["management", "cookies"];
-  const hostPermissions = ["*://example.org/", "https://foo.example.org/"];
-
-  let manifest = {
-    applications: {
-      gecko: {
-        id,
-        update_url: "https://updates.mozilla.com/",
-      },
-    },
-    name: "test extension name",
-    short_name: "test extension short name",
-    description: "test extension description",
-    version: "1.0",
-    homepage_url: "http://www.example.com/",
-    options_ui: {
-      "page": "get_self_options.html",
-    },
-    icons: {
-      "16": "icons/icon-16.png",
-      "48": "icons/icon-48.png",
-    },
-    permissions: [...permissions, ...hostPermissions],
-  };
-
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest,
-    background: backgroundGetSelf,
-    useAddonManager: "temporary",
-  });
-  yield extension.startup();
-  let extInfo = yield extension.awaitMessage("management-getSelf");
-
-  equal(extInfo.id, id, "getSelf returned the expected id");
-  equal(extInfo.installType, "development", "getSelf returned the expected installType");
-  for (let prop of ["name", "description", "version"]) {
-    equal(extInfo[prop], manifest[prop], `getSelf returned the expected ${prop}`);
-  }
-  equal(extInfo.shortName, manifest.short_name, "getSelf returned the expected shortName");
-  equal(extInfo.mayDisable, true, "getSelf returned the expected value for mayDisable");
-  equal(extInfo.enabled, true, "getSelf returned the expected value for enabled");
-  equal(extInfo.homepageUrl, manifest.homepage_url, "getSelf returned the expected homepageUrl");
-  equal(extInfo.updateUrl, manifest.applications.gecko.update_url, "getSelf returned the expected updateUrl");
-  ok(extInfo.optionsUrl.endsWith(manifest.options_ui.page), "getSelf returned the expected optionsUrl");
-  for (let [index, size] of Object.keys(manifest.icons).sort().entries()) {
-    equal(extInfo.icons[index].size, +size, "getSelf returned the expected icon size");
-    equal(extInfo.icons[index].url, manifest.icons[size], "getSelf returned the expected icon url");
-  }
-  deepEqual(extInfo.permissions.sort(), permissions.sort(), "getSelf returned the expected permissions");
-  deepEqual(extInfo.hostPermissions.sort(), hostPermissions.sort(), "getSelf returned the expected hostPermissions");
-  equal(extInfo.installType, "development", "getSelf returned the expected installType");
-  yield extension.unload();
-});
-
-add_task(function* test_management_get_self_minimal() {
-  const id = "get_self_test_minimal@tests.mozilla.com";
-
-  let manifest = {
-    applications: {
-      gecko: {
-        id,
-      },
-    },
-    name: "test extension name",
-    version: "1.0",
-  };
-
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest,
-    background: backgroundGetSelf,
-    useAddonManager: "temporary",
-  });
-  yield extension.startup();
-  let extInfo = yield extension.awaitMessage("management-getSelf");
-
-  equal(extInfo.id, id, "getSelf returned the expected id");
-  equal(extInfo.installType, "development", "getSelf returned the expected installType");
-  for (let prop of ["name", "version"]) {
-    equal(extInfo[prop], manifest[prop], `getSelf returned the expected ${prop}`);
-  }
-  for (let prop of ["shortName", "description", "optionsUrl"]) {
-    equal(extInfo[prop], "", `getSelf returned the expected ${prop}`);
-  }
-  for (let prop of ["homepageUrl", " updateUrl", "icons"]) {
-    equal(Reflect.getOwnPropertyDescriptor(extInfo, prop), undefined, `getSelf did not return a ${prop} property`);
-  }
-  for (let prop of ["permissions", "hostPermissions"]) {
-    deepEqual(extInfo[prop], [], `getSelf returned the expected ${prop}`);
-  }
-  yield extension.unload();
-});
-
-add_task(function* test_management_get_self_permanent() {
-  const id = "get_self_test_permanent@tests.mozilla.com";
-
-  let manifest = {
-    applications: {
-      gecko: {
-        id,
-      },
-    },
-    name: "test extension name",
-    version: "1.0",
-  };
-
-  let extension = ExtensionTestUtils.loadExtension({
-    manifest,
-    background: backgroundGetSelf,
-    useAddonManager: "permanent",
-  });
-  yield extension.startup();
-  let extInfo = yield extension.awaitMessage("management-getSelf");
-
-  equal(extInfo.id, id, "getSelf returned the expected id");
-  equal(extInfo.installType, "normal", "getSelf returned the expected installType");
-  yield extension.unload();
-});
--- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
+++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
@@ -312,9 +312,8 @@ skip-if = appname == "thunderbird"
 skip-if = os != "win"
 [test_bug1180901.js]
 skip-if = os != "win"
 [test_e10s_restartless.js]
 [test_switch_os.js]
 # Bug 1246231
 skip-if = os == "mac" && debug
 [test_softblocked.js]
-[test_ext_management.js]