зеркало из https://github.com/mozilla/gecko-dev.git
Backout bug 741972 / changeset 993d0e9edd3f due to test failures
This commit is contained in:
Родитель
17fb537275
Коммит
7dbd0da436
|
@ -16,8 +16,23 @@ function end_test() {
|
|||
add_test(function() {
|
||||
info("Testing compatibility checking warning");
|
||||
|
||||
info("Setting checkCompatibility to false");
|
||||
AddonManager.checkCompatibility = false;
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
var version = "nightly";
|
||||
}
|
||||
else {
|
||||
version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
|
||||
}
|
||||
|
||||
var pref = "extensions.checkCompatibility." + version;
|
||||
info("Setting " + pref + " pref to false")
|
||||
Services.prefs.setBoolPref(pref, false);
|
||||
|
||||
open_manager("addons://list/extension", function(aWindow) {
|
||||
var hbox = aWindow.document.querySelector("#list-view hbox.global-warning-checkcompatibility");
|
||||
|
|
|
@ -19,6 +19,22 @@ var gProvider;
|
|||
var gServer;
|
||||
var gAddonInstalled = false;
|
||||
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
var version = "nightly";
|
||||
}
|
||||
else {
|
||||
version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
|
||||
}
|
||||
|
||||
const COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
|
||||
|
||||
function test() {
|
||||
requestLongerTimeout(2);
|
||||
// Turn on searching for this test
|
||||
|
@ -592,7 +608,7 @@ add_test(function() {
|
|||
|
||||
// Tests that incompatible add-ons are shown with a warning if compatibility checking is disabled
|
||||
add_test(function() {
|
||||
AddonManager.checkCompatiblity = false;
|
||||
Services.prefs.setBoolPref(COMPATIBILITY_PREF, false);
|
||||
search("incompatible", false, function() {
|
||||
var item = get_addon_item("remote5");
|
||||
is_element_visible(item, "Incompatible addon should be visible");
|
||||
|
@ -601,7 +617,7 @@ add_test(function() {
|
|||
var item = get_addon_item("remote6");
|
||||
is(item, null, "Addon incompatible with the product should not be visible");
|
||||
|
||||
AddonManager.checkCompatiblity = true;
|
||||
Services.prefs.clearUserPref(COMPATIBILITY_PREF);
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -26,10 +26,6 @@ var gAddonsList;
|
|||
|
||||
var TEST_UNPACKED = false;
|
||||
|
||||
function isNightlyChannel(channel) {
|
||||
return channel != "aurora" && channel != "beta" && channel != "release" && channel != "esr";
|
||||
}
|
||||
|
||||
function createAppInfo(id, name, version, platformVersion) {
|
||||
gAppInfo = {
|
||||
// nsIXULAppInfo
|
||||
|
|
|
@ -15,6 +15,19 @@ function run_test() {
|
|||
do_test_pending();
|
||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
||||
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
} catch (e) { }
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
var version = "nightly";
|
||||
} else {
|
||||
version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
|
||||
}
|
||||
COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
|
||||
|
||||
// Create and configure the HTTP server.
|
||||
gServer = new nsHttpServer();
|
||||
gServer.registerDirectory("/data/", do_get_file("data"));
|
||||
|
@ -71,7 +84,7 @@ function run_test_2() {
|
|||
// Compatibility checking disabled.
|
||||
function run_test_3() {
|
||||
do_print("Testing with all compatibility checking disabled");
|
||||
AddonManager.checkCompatibility = false;
|
||||
Services.prefs.setBoolPref(COMPATIBILITY_PREF, false);
|
||||
|
||||
AddonRepository.searchAddons("test", 6, {
|
||||
searchSucceeded: function(aAddons) {
|
||||
|
|
|
@ -38,8 +38,21 @@
|
|||
|
||||
// Disables security checking our updates which haven't been signed
|
||||
Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
|
||||
// Disables compatibility checking
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
AddonManager.checkCompatibility = false;
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
|
||||
}
|
||||
else {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2", false);
|
||||
}
|
||||
|
||||
var ADDONS = [
|
||||
"test_bug470377_1",
|
||||
|
|
|
@ -102,8 +102,21 @@ function run_test_1() {
|
|||
}
|
||||
|
||||
function run_test_2() {
|
||||
AddonManager.checkCompatibility = false;
|
||||
// Disable compatibility checks
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
|
||||
}
|
||||
else {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
|
||||
}
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
|
|
|
@ -101,8 +101,21 @@ function run_test_1() {
|
|||
}
|
||||
|
||||
function run_test_2() {
|
||||
AddonManager.checkCompatibility = false;
|
||||
// Disable compatibility checks
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
|
||||
}
|
||||
else {
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
|
||||
}
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
|
|
|
@ -36,6 +36,21 @@
|
|||
* ***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
var checkCompatPref = "extensions.checkCompatibility.nightly";
|
||||
}
|
||||
else {
|
||||
checkCompatPref = "extensions.checkCompatibility.2.1a";
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.1a4", "2");
|
||||
|
@ -73,8 +88,8 @@ function run_test() {
|
|||
}
|
||||
|
||||
function run_test_1() {
|
||||
AddonManager.checkCompatibility = false;
|
||||
|
||||
// Disable compatibility checks
|
||||
Services.prefs.setBoolPref(checkCompatPref, false);
|
||||
startupManager();
|
||||
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
|
@ -99,8 +114,8 @@ function run_test_1() {
|
|||
}
|
||||
|
||||
function run_test_2() {
|
||||
AddonManager.checkCompatibility = true;
|
||||
|
||||
// Enable compatibility checks
|
||||
Services.prefs.setBoolPref(checkCompatPref, true);
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddonsByIDs(["bug470377_1@tests.mozilla.org",
|
||||
|
|
|
@ -41,7 +41,8 @@ const ID = "bug521905@tests.mozilla.org";
|
|||
|
||||
// Disables security checking our updates which haven't been signed
|
||||
Services.prefs.setBoolPref("extensions.checkUpdateSecurity", false);
|
||||
AddonManager.checkCompatibility = false;
|
||||
// Disables compatibility checking
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.0pre", false);
|
||||
|
||||
function run_test() {
|
||||
var channel = "default";
|
||||
|
@ -52,7 +53,9 @@ function run_test() {
|
|||
|
||||
// This test is only relevant on builds where the version is included in the
|
||||
// checkCompatibility preference name
|
||||
if (isNightlyChannel(channel)) {
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,6 +59,8 @@ var ADDONS = [{
|
|||
const profileDir = gProfD.clone();
|
||||
profileDir.append("extensions");
|
||||
|
||||
var gIsNightly = false;
|
||||
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2.2.3", "2");
|
||||
|
@ -67,6 +69,16 @@ function run_test() {
|
|||
writeInstallRDFForExtension(a, profileDir);
|
||||
});
|
||||
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
gIsNightly = channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release";
|
||||
|
||||
startupManager();
|
||||
|
||||
run_test_1();
|
||||
|
@ -133,8 +145,10 @@ function run_test_1() {
|
|||
// Tests that with compatibility checking disabled we see the incompatible
|
||||
// add-ons enabled
|
||||
function run_test_2() {
|
||||
AddonManager.checkCompatibility = false;
|
||||
|
||||
if (gIsNightly)
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", false);
|
||||
else
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.2", false);
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
|
@ -152,14 +166,8 @@ function run_test_2() {
|
|||
// Tests that with compatibility checking disabled we see the incompatible
|
||||
// add-ons enabled.
|
||||
function run_test_3() {
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
if (!isNightlyChannel(channel))
|
||||
AddonManager.checkCompatibility = false;
|
||||
if (!gIsNightly)
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", false);
|
||||
restartManager("2.1a4");
|
||||
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
|
@ -177,8 +185,10 @@ function run_test_3() {
|
|||
// Tests that with compatibility checking enabled we see the incompatible
|
||||
// add-ons disabled.
|
||||
function run_test_4() {
|
||||
AddonManager.checkCompatibility = true;
|
||||
|
||||
if (gIsNightly)
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.nightly", true);
|
||||
else
|
||||
Services.prefs.setBoolPref("extensions.checkCompatibility.2.1a", true);
|
||||
restartManager();
|
||||
|
||||
AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org",
|
||||
|
|
|
@ -132,7 +132,9 @@ function run_test() {
|
|||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
} catch (e) { }
|
||||
if (isNightlyChannel(channel)) {
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
var version = "nightly";
|
||||
} else {
|
||||
version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
|
||||
|
|
|
@ -14,10 +14,25 @@ var testserver;
|
|||
const profileDir = gProfD.clone();
|
||||
profileDir.append("extensions");
|
||||
|
||||
var COMPATIBILITY_PREF;
|
||||
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
||||
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
} catch (e) { }
|
||||
if (channel != "aurora" &&
|
||||
channel != "beta" &&
|
||||
channel != "release") {
|
||||
var version = "nightly";
|
||||
} else {
|
||||
version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
|
||||
}
|
||||
COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
|
||||
|
||||
// Create and configure the HTTP server.
|
||||
testserver = new nsHttpServer();
|
||||
testserver.registerDirectory("/data/", do_get_file("data"));
|
||||
|
@ -159,7 +174,7 @@ function run_test_3() {
|
|||
// Compatibility checking disabled.
|
||||
function run_test_4() {
|
||||
do_print("Testing with all compatibility checking disabled");
|
||||
AddonManager.checkCompatibility = false;
|
||||
Services.prefs.setBoolPref(COMPATIBILITY_PREF, false);
|
||||
AddonManager.getAddonByID("compatmode-ignore@tests.mozilla.org", function(addon) {
|
||||
do_check_neq(addon, null);
|
||||
addon.findUpdates({
|
||||
|
|
|
@ -6,12 +6,24 @@
|
|||
|
||||
Components.utils.import("resource://gre/modules/AddonUpdateChecker.jsm");
|
||||
|
||||
var COMPATIBILITY_PREF;
|
||||
|
||||
do_load_httpd_js();
|
||||
var testserver;
|
||||
|
||||
function run_test() {
|
||||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
|
||||
|
||||
var channel = "default";
|
||||
try {
|
||||
channel = Services.prefs.getCharPref("app.update.channel");
|
||||
} catch (e) { }
|
||||
if (channel != "aurora" && channel != "beta" && channel != "release")
|
||||
var version = "nightly";
|
||||
else
|
||||
version = Services.appinfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1");
|
||||
COMPATIBILITY_PREF = "extensions.checkCompatibility." + version;
|
||||
|
||||
// Create and configure the HTTP server.
|
||||
testserver = new nsHttpServer();
|
||||
testserver.registerDirectory("/data/", do_get_file("data"));
|
||||
|
|
Загрузка…
Ссылка в новой задаче