Bug 1366827 - Enable WebExtension experiments in Beta and Release. r=aswan draft
authorJared Hirsch <ohai@6a68.net>
Fri, 02 Jun 2017 12:04:01 -0700
changeset 588443 2a491b00179859d95f78e3f8fa4101a7a5ba759c
parent 588345 87c745019518b1d6cd782534f2553721e5735657
child 631573 54c2e5b40c3304bf928a727594850e52e09b3a72
push id62037
push userbmo:jhirsch@mozilla.com
push dateFri, 02 Jun 2017 20:07:23 +0000
reviewersaswan
bugs1366827
milestone55.0a1
Bug 1366827 - Enable WebExtension experiments in Beta and Release. r=aswan MozReview-Commit-ID: 1Z5p4AoelPu
toolkit/components/extensions/ExtensionParent.jsm
toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
toolkit/components/extensions/test/xpcshell/xpcshell.ini
toolkit/mozapps/extensions/internal/XPIInstall.jsm
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
--- a/toolkit/components/extensions/ExtensionParent.jsm
+++ b/toolkit/components/extensions/ExtensionParent.jsm
@@ -63,19 +63,17 @@ const CATEGORY_EXTENSION_SCHEMAS = "webe
 const CATEGORY_EXTENSION_SCRIPTS = "webextension-scripts";
 
 const XUL_URL = "data:application/vnd.mozilla.xul+xml;charset=utf-8," + encodeURI(
   `<?xml version="1.0"?>
   <window id="documentElement"/>`);
 
 let schemaURLs = new Set();
 
-if (!AppConstants.RELEASE_OR_BETA) {
-  schemaURLs.add("chrome://extensions/content/schemas/experiments.json");
-}
+schemaURLs.add("chrome://extensions/content/schemas/experiments.json");
 
 let GlobalManager;
 let ParentAPIManager;
 let ProxyMessenger;
 
 // This object loads the ext-*.js scripts that define the extension API.
 let apiManager = new class extends SchemaAPIManager {
   constructor() {
--- a/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell-common.ini
@@ -19,17 +19,16 @@ skip-if = os == "android" # Containers a
 [test_ext_downloads.js]
 [test_ext_downloads_download.js]
 skip-if = os == "android"
 [test_ext_downloads_misc.js]
 skip-if = os == "android" || (os=='linux' && bits==32) # linux32: bug 1324870
 [test_ext_downloads_search.js]
 skip-if = os == "android"
 [test_ext_experiments.js]
-skip-if = release_or_beta
 [test_ext_extension.js]
 [test_ext_extensionPreferencesManager.js]
 [test_ext_extensionSettingsStore.js]
 [test_ext_extension_startup_telemetry.js]
 [test_ext_idle.js]
 [test_ext_localStorage.js]
 [test_ext_management.js]
 [test_ext_management_uninstall_self.js]
--- a/toolkit/components/extensions/test/xpcshell/xpcshell.ini
+++ b/toolkit/components/extensions/test/xpcshell/xpcshell.ini
@@ -32,17 +32,16 @@ skip-if = os == "android" # Containers a
 [test_ext_downloads.js]
 [test_ext_downloads_download.js]
 skip-if = os == "android"
 [test_ext_downloads_misc.js]
 skip-if = os == "android" || (os=='linux' && bits==32) # linux32: bug 1324870
 [test_ext_downloads_search.js]
 skip-if = os == "android"
 [test_ext_experiments.js]
-skip-if = release_or_beta
 [test_ext_extension.js]
 [test_ext_extensionPreferencesManager.js]
 [test_ext_extensionSettingsStore.js]
 [test_ext_extension_startup_telemetry.js]
 [test_ext_idle.js]
 [test_ext_json_parser.js]
 [test_ext_localStorage.js]
 [test_ext_management.js]
--- a/toolkit/mozapps/extensions/internal/XPIInstall.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIInstall.jsm
@@ -150,24 +150,22 @@ const PROP_TARGETAPP     = ["id", "minVe
 // Type 32 was previously used for multipackage xpi files so it should
 // not be re-used since old files with that type may be floating around.
 const TYPES = {
   extension: 2,
   theme: 4,
   locale: 8,
   dictionary: 64,
   experiment: 128,
+  apiextension: 256,
 };
 
-if (!AppConstants.RELEASE_OR_BETA)
-   TYPES.apiextension = 256;
-
 const COMPATIBLE_BY_DEFAULT_TYPES = {
   extension: true,
-  dictionary: true
+  dictionary: true,
 };
 
 const RESTARTLESS_TYPES = new Set([
   "apiextension",
   "dictionary",
   "experiment",
   "locale",
   "webextension",
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -238,30 +238,16 @@ const BOOTSTRAP_REASONS = {
   ADDON_ENABLE: 3,
   ADDON_DISABLE: 4,
   ADDON_INSTALL: 5,
   ADDON_UNINSTALL: 6,
   ADDON_UPGRADE: 7,
   ADDON_DOWNGRADE: 8
 };
 
-// Map new string type identifiers to old style nsIUpdateItem types
-// Type 32 was previously used for multipackage xpi files so it should
-// not be re-used since old files with that type may be floating around.
-const TYPES = {
-  extension: 2,
-  theme: 4,
-  locale: 8,
-  dictionary: 64,
-  experiment: 128,
-};
-
-if (!AppConstants.RELEASE_OR_BETA)
-  TYPES.apiextension = 256;
-
 // Some add-on types that we track internally are presented as other types
 // externally
 const TYPE_ALIASES = {
   "apiextension": "extension",
   "webextension": "extension",
   "webextension-theme": "theme",
 };
 
--- a/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js
@@ -278,20 +278,16 @@ add_task(async function test_options_ui(
   ok(OPTIONS_RE.test(addon.optionsURL),
      "Addon should have a moz-extension: options URL for /options.html");
 
   addon.uninstall();
 });
 
 // Test that experiments permissions add the appropriate dependencies.
 add_task(async function test_experiments_dependencies() {
-  if (AppConstants.RELEASE_OR_BETA)
-    // Experiments are not enabled on release builds.
-    return;
-
   let addonFile = createTempWebExtensionFile({
     manifest: {
       applications: {gecko: {id: "meh@experiment"}},
       "permissions": ["experiments.meh"],
     },
   });
 
   await promiseInstallAllFiles([addonFile]);
@@ -303,20 +299,16 @@ add_task(async function test_experiments
 
   equal(addon.appDisabled, true, "Add-on should be app disabled due to missing dependencies");
 
   addon.uninstall();
 });
 
 // Test that experiments API extensions install correctly.
 add_task(async function test_experiments_api() {
-  if (AppConstants.RELEASE_OR_BETA)
-    // Experiments are not enabled on release builds.
-    return;
-
   const extensionId = "meh@experiments.addons.mozilla.org";
 
   let addonFile = createTempXPIFile({
     id: extensionId,
     type: 256,
     version: "0.1",
     name: "Meh API",
   });