Bug 1393156 Remove obsolete theme compatbility override feature r=kmag
authorAndrew Swan <aswan@mozilla.com>
Sat, 26 Aug 2017 08:03:36 -0700
changeset 377177 eb1d6805d426894dbf7a712f858ed85788e56224
parent 377176 0a4d1c750d9a6aa6813faef387f7cce62a9e6e1b
child 377178 0f29beef0059937c9eb45fa0d37eaa22d854e4ab
push id32402
push userarchaeopteryx@coole-files.de
push dateMon, 28 Aug 2017 14:47:04 +0000
treeherdermozilla-central@d5b6d113cf17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1393156
milestone57.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 1393156 Remove obsolete theme compatbility override feature r=kmag MozReview-Commit-ID: GGxmjMO1HCN
toolkit/mozapps/extensions/internal/XPIProvider.jsm
toolkit/mozapps/extensions/test/xpcshell/test_checkCompatibility_themeOverride.js
toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -91,18 +91,16 @@ const PREF_E10S_ADDON_BLOCKLIST       = 
 const PREF_E10S_ADDON_POLICY          = "extensions.e10s.rollout.policy";
 const PREF_E10S_HAS_NONEXEMPT_ADDON   = "extensions.e10s.rollout.hasAddon";
 const PREF_ALLOW_LEGACY               = "extensions.legacy.enabled";
 const PREF_ALLOW_NON_MPC              = "extensions.allow-non-mpc-extensions";
 
 const PREF_EM_MIN_COMPAT_APP_VERSION      = "extensions.minCompatibleAppVersion";
 const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVersion";
 
-const PREF_CHECKCOMAT_THEMEOVERRIDE   = "extensions.checkCompatibility.temporaryThemeOverride_minAppVersion";
-
 const PREF_EM_HOTFIX_ID               = "extensions.hotfix.id";
 
 const OBSOLETE_PREFERENCES = [
   "extensions.bootstrappedAddons",
   "extensions.enabledAddons",
   "extensions.xpiState",
   "extensions.installCache",
 ];
@@ -837,30 +835,16 @@ function isUsableAddon(aAddon) {
       return false;
     }
   } else {
     let app = aAddon.matchingTargetApplication;
     if (!app) {
       logger.warn(`Add-on ${aAddon.id} is not compatible with target application.`);
       return false;
     }
-
-    // XXX Temporary solution to let applications opt-in to make themes safer
-    //     following significant UI changes even if checkCompatibility=false has
-    //     been set, until we get bug 962001.
-    if (aAddon.type == "theme" && app.id == Services.appinfo.ID) {
-      try {
-        let minCompatVersion = Services.prefs.getCharPref(PREF_CHECKCOMAT_THEMEOVERRIDE);
-        if (minCompatVersion &&
-            Services.vc.compare(minCompatVersion, app.maxVersion) > 0) {
-          logger.warn(`Theme ${aAddon.id} is not compatible with application version.`);
-          return false;
-        }
-      } catch (e) {}
-    }
   }
 
   return true;
 }
 
 function createAddonDetails(id, aAddon) {
   return {
     id: id || aAddon.id,
deleted file mode 100644
--- a/toolkit/mozapps/extensions/test/xpcshell/test_checkCompatibility_themeOverride.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// This verifies that the (temporary)
-// extensions.checkCompatibility.temporaryThemeOverride_minAppVersion
-// preference works.
-
-var ADDONS = [{
-  id: "addon1@tests.mozilla.org",
-  type: 4,
-  internalName: "theme1/1.0",
-  version: "1.0",
-  name: "Test 1",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "1.0",
-    maxVersion: "1.0"
-  }]
-}, {
-  id: "addon2@tests.mozilla.org",
-  type: 4,
-  internalName: "theme2/1.0",
-  version: "1.0",
-  name: "Test 2",
-  targetApplications: [{
-    id: "xpcshell@tests.mozilla.org",
-    minVersion: "2.0",
-    maxVersion: "2.0"
-  }]
-}];
-
-const profileDir = gProfD.clone();
-profileDir.append("extensions");
-
-
-function run_test() {
-  do_test_pending();
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "3.0", "1");
-
-  for (let a of ADDONS) {
-    writeInstallRDFForExtension(a, profileDir);
-  }
-
-  startupManager();
-
-  run_test_1();
-}
-
-function run_test_1() {
-  AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
-                               "addon2@tests.mozilla.org"],
-                               function([a1, a2]) {
-
-    do_check_neq(a1, null);
-    do_check_false(a1.isActive);
-    do_check_false(a1.isCompatible);
-    do_check_true(a1.appDisabled);
-
-    do_check_neq(a2, null);
-    do_check_false(a2.isActive);
-    do_check_false(a2.isCompatible);
-    do_check_true(a1.appDisabled);
-
-    do_execute_soon(run_test_2);
-  });
-}
-
-function run_test_2() {
-  Services.prefs.setCharPref("extensions.checkCompatibility.temporaryThemeOverride_minAppVersion", "2.0");
-  if (isNightlyChannel())
-    Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
-  else
-    Services.prefs.setBoolPref("extensions.checkCompatibility.3.0", false);
-  restartManager();
-
-  AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
-                               "addon2@tests.mozilla.org"],
-                               function([a1, a2]) {
-
-    do_check_neq(a1, null);
-    do_check_false(a1.isActive);
-    do_check_false(a1.isCompatible);
-    do_check_true(a1.appDisabled);
-
-    do_check_neq(a2, null);
-    do_check_false(a2.isActive);
-    do_check_false(a2.isCompatible);
-    do_check_false(a2.appDisabled);
-
-    do_execute_soon(do_test_finished);
-  });
-}
--- a/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
+++ b/toolkit/mozapps/extensions/test/xpcshell/xpcshell-shared.ini
@@ -165,17 +165,16 @@ tags = blocklist
 [test_bug655254.js]
 [test_bug659772.js]
 [test_bug675371.js]
 [test_bug740612.js]
 [test_bug753900.js]
 [test_bug757663.js]
 [test_bug953156.js]
 [test_checkcompatibility.js]
-[test_checkCompatibility_themeOverride.js]
 [test_childprocess.js]
 [test_ChromeManifestParser.js]
 [test_compatoverrides.js]
 [test_corrupt.js]
 [test_corrupt_strictcompat.js]
 [test_corruptfile.js]
 [test_dataDirectory.js]
 [test_default_providers_pref.js]