From 3d4296895e8f4f4c7838ce9d6d3dc0d6818fd8c9 Mon Sep 17 00:00:00 2001 From: Thomas Prip Vestergaard Date: Thu, 29 Dec 2011 18:56:51 -0600 Subject: [PATCH 1/3] Bug 711540 - Align text in "Video statistics" to the left --- toolkit/content/widgets/videocontrols.css | 1 + 1 file changed, 1 insertion(+) diff --git a/toolkit/content/widgets/videocontrols.css b/toolkit/content/widgets/videocontrols.css index 75b5a8ab286b..d100682df41f 100644 --- a/toolkit/content/widgets/videocontrols.css +++ b/toolkit/content/widgets/videocontrols.css @@ -20,6 +20,7 @@ .mediaControlsFrame { direction: ltr; /* Prevent unwanted style inheritance. See bug 554717. */ + text-align: left; list-style-image: none !important; font: normal normal normal 100%/normal sans-serif !important; text-decoration: none !important; From 36c8b73fe5ace40ec75cd9f2a8a72939b81d1823 Mon Sep 17 00:00:00 2001 From: Blair McBride Date: Fri, 30 Dec 2011 13:53:03 +1300 Subject: [PATCH 2/3] Bug 713816 - Add additional logging when parsing compatibility overrides. r=dtownsend --HG-- extra : rebase_source : 78b866fc90e11847b726403a735b596ab609145e --- .../mozapps/extensions/AddonRepository.jsm | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/toolkit/mozapps/extensions/AddonRepository.jsm b/toolkit/mozapps/extensions/AddonRepository.jsm index c33eb2244b0a..11573851fcfc 100644 --- a/toolkit/mozapps/extensions/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/AddonRepository.jsm @@ -1257,8 +1257,10 @@ var AddonRepository = { // Parses addon_compatibility nodes, that describe compatibility overrides. _parseAddonCompatElement: function(aResultObj, aElement) { let guid = this._getDescendantTextContent(aElement, "guid"); - if (!guid) + if (!guid) { + LOG("Compatibility override is missing guid."); return; + } let compat = {id: guid}; compat.hosted = aElement.getAttribute("hosted") != "false"; @@ -1292,21 +1294,31 @@ var AddonRepository = { function parseRangeNode(aNode) { let type = aNode.getAttribute("type"); // Only "incompatible" (blacklisting) is supported for now. - if (type != "incompatible") + if (type != "incompatible") { + LOG("Compatibility override of unsupported type found."); return null; + } let override = new AddonManagerPrivate.AddonCompatibilityOverride(type); override.minVersion = this._getDirectDescendantTextContent(aNode, "min_version"); override.maxVersion = this._getDirectDescendantTextContent(aNode, "max_version"); - if (!override.minVersion || !override.maxVersion) + if (!override.minVersion) { + LOG("Compatibility override is missing min_version."); return null; + } + if (!override.maxVersion) { + LOG("Compatibility override is missing max_version."); + return null; + } let appRanges = aNode.querySelectorAll("compatible_applications > application"); let appRange = findMatchingAppRange.bind(this)(appRanges); - if (!appRange) + if (!appRange) { + LOG("Compatibility override is missing a valid application range."); return null; + } override.appID = appRange.appID; override.appMinVersion = appRange.appMinVersion; From eabc3b3481062bb4244c8d2e6080926de9101829 Mon Sep 17 00:00:00 2001 From: Blair McBride Date: Fri, 30 Dec 2011 13:53:52 +1300 Subject: [PATCH 3/3] Bug 713815 - Addons with compatibility overrides are still able to be installed. r=dtownsend --HG-- extra : rebase_source : 535a75a745b3e1b9b9ccb5013f77b889d7283867 --- toolkit/mozapps/extensions/XPIProvider.jsm | 2 + .../test/addons/test_install6/install.rdf | 24 ++++++++++ .../test/xpcshell/data/test_install.xml | 19 ++++++++ .../extensions/test/xpcshell/test_install.js | 47 ++++++++++++++++++- 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 toolkit/mozapps/extensions/test/addons/test_install6/install.rdf diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/XPIProvider.jsm index 0288121449d1..530add649a09 100644 --- a/toolkit/mozapps/extensions/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/XPIProvider.jsm @@ -6148,6 +6148,7 @@ AddonInstall.prototype = { if (aRepoAddon) { aAddon._repositoryAddon = aRepoAddon; aAddon.compatibilityOverrides = aRepoAddon.compatibilityOverrides; + aAddon.appDisabled = !isUsableAddon(aAddon); aCallback(); return; } @@ -6159,6 +6160,7 @@ AddonInstall.prototype = { aAddon.compatibilityOverrides = aRepoAddon ? aRepoAddon.compatibilityOverrides : null; + aAddon.appDisabled = !isUsableAddon(aAddon); aCallback(); }); }); diff --git a/toolkit/mozapps/extensions/test/addons/test_install6/install.rdf b/toolkit/mozapps/extensions/test/addons/test_install6/install.rdf new file mode 100644 index 000000000000..b1f97c1fd47a --- /dev/null +++ b/toolkit/mozapps/extensions/test/addons/test_install6/install.rdf @@ -0,0 +1,24 @@ + + + + + + + addon6@tests.mozilla.org + 1.0 + + + Addon Test 6 + Test Description + + + + xpcshell@tests.mozilla.org + 1 + 1 + + + + + diff --git a/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml b/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml index 7c47f8a42bf4..33f14a2fdcff 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml +++ b/toolkit/mozapps/extensions/test/xpcshell/data/test_install.xml @@ -31,4 +31,23 @@ ALL http://example.com/browser/toolkit/mozapps/extensions/test/browser/addons/browser_install1_2.xpi + + + addon6@tests.mozilla.org + Addon Test 6 + + + 1.0 + 1.0 + + + XPCShell + 1.0 + 1.0 + xpcshell@tests.mozilla.org + + + + + diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_install.js b/toolkit/mozapps/extensions/test/xpcshell/test_install.js index 21283692f8f4..bcc153a673a0 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_install.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_install.js @@ -1678,7 +1678,52 @@ function check_test_28(install) { function finish_test_28(install) { prepare_test({}, [ "onDownloadCancelled" - ], do_test_finished); + ], run_test_29); install.cancel(); } + +// Tests that an install with a matching compatibility override has appDisabled +// set correctly. +function run_test_29() { + Services.prefs.setBoolPref("extensions.getAddons.cache.enabled", true); + + prepare_test({ }, [ + "onNewInstall" + ]); + + let url = "http://localhost:4444/addons/test_install6.xpi"; + AddonManager.getInstallForURL(url, function(install) { + ensure_test_completed(); + + do_check_neq(install, null); + do_check_eq(install.version, "1.0"); + do_check_eq(install.name, "Addon Test 6"); + do_check_eq(install.state, AddonManager.STATE_AVAILABLE); + + AddonManager.getInstallsByTypes(null, function(activeInstalls) { + do_check_eq(activeInstalls.length, 1); + do_check_eq(activeInstalls[0], install); + + prepare_test({}, [ + "onDownloadStarted", + "onDownloadEnded" + ], check_test_29); + install.install(); + }); + }, "application/x-xpinstall", null, "Addon Test 6", null, "1.0"); +} + +function check_test_29(install) { + //ensure_test_completed(); + do_check_eq(install.state, AddonManager.STATE_DOWNLOADED); + do_check_neq(install.addon, null); + do_check_false(install.addon.isCompatible); + do_check_true(install.addon.appDisabled); + + prepare_test({}, [ + "onDownloadCancelled" + ], do_test_finished); + install.cancel(); + return false; +}