diff options
Diffstat (limited to 'toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js')
-rw-r--r-- | toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js b/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js index fad015886..b2903ead7 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_migrate4.js @@ -98,7 +98,7 @@ var defaultTheme = { const profileDir = gProfD.clone(); profileDir.append("extensions"); -var oldSyncGUIDs = {}; +let oldSyncGUIDs = {}; function prepare_profile() { createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); @@ -132,7 +132,7 @@ function prepare_profile() { a6.userDisabled = true; a9.userDisabled = false; - for (let addon of [a1, a2, a3, a4, a5, a6]) { + for each (let addon in [a1, a2, a3, a4, a5, a6]) { oldSyncGUIDs[addon.id] = addon.syncGUID; } @@ -141,18 +141,18 @@ function prepare_profile() { AddonManager.getInstallForURL("http://localhost:" + gPort + "/addons/test_migrate4_7.xpi", function(aInstall7) { completeAllInstalls([aInstall6, aInstall7], function() { restartManager(); - + AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org", "addon2@tests.mozilla.org", "addon3@tests.mozilla.org", "addon4@tests.mozilla.org", "addon5@tests.mozilla.org", "addon6@tests.mozilla.org"], - function([a1_2, a2_2, a3_2, a4_2, a5_2, a6_2]) { - a3_2.userDisabled = true; - a4_2.userDisabled = false; - - a5_2.findUpdates({ + function([a1, a2, a3, a4, a5, a6]) { + a3.userDisabled = true; + a4.userDisabled = false; + + a5.findUpdates({ onUpdateFinished: function() { do_execute_soon(perform_migration); } @@ -168,16 +168,11 @@ function prepare_profile() { function perform_migration() { shutdownManager(); - + // Turn on disabling for all scopes Services.prefs.setIntPref("extensions.autoDisableScopes", 15); - changeXPIDBVersion(1, data => { - // Delete the seen property from all add-ons to make sure it defaults to true - for (let addon of data.addons) { - delete addon.seen; - } - }); + changeXPIDBVersion(1); Services.prefs.setIntPref("extensions.databaseSchema", 1); gAppInfo.version = "2" @@ -210,7 +205,6 @@ function test_results() { do_check_true(a1.isActive); do_check_eq(a1.applyBackgroundUpdates, AddonManager.AUTOUPDATE_DEFAULT); do_check_true(a1.foreignInstall); - do_check_true(a1.seen); do_check_false(a1.hasBinaryComponents); do_check_false(a1.strictCompatibility); @@ -222,7 +216,6 @@ function test_results() { do_check_false(a2.isActive); do_check_eq(a2.applyBackgroundUpdates, AddonManager.AUTOUPDATE_DISABLE); do_check_true(a2.foreignInstall); - do_check_true(a2.seen); do_check_false(a2.hasBinaryComponents); do_check_false(a2.strictCompatibility); @@ -234,7 +227,6 @@ function test_results() { do_check_false(a3.isActive); do_check_eq(a3.applyBackgroundUpdates, AddonManager.AUTOUPDATE_ENABLE); do_check_true(a3.foreignInstall); - do_check_true(a3.seen); do_check_false(a3.hasBinaryComponents); do_check_false(a3.strictCompatibility); @@ -246,7 +238,6 @@ function test_results() { do_check_true(a4.isActive); do_check_eq(a4.applyBackgroundUpdates, AddonManager.AUTOUPDATE_DEFAULT); do_check_true(a4.foreignInstall); - do_check_true(a4.seen); do_check_false(a4.hasBinaryComponents); do_check_true(a4.strictCompatibility); @@ -257,7 +248,6 @@ function test_results() { do_check_true(a5.isActive); do_check_eq(a4.applyBackgroundUpdates, AddonManager.AUTOUPDATE_DEFAULT); do_check_true(a5.foreignInstall); - do_check_true(a5.seen); do_check_false(a5.hasBinaryComponents); do_check_false(a5.strictCompatibility); @@ -270,7 +260,6 @@ function test_results() { do_check_false(a6.isActive); do_check_eq(a6.applyBackgroundUpdates, AddonManager.AUTOUPDATE_DEFAULT); do_check_true(a6.foreignInstall); - do_check_true(a6.seen); do_check_eq(a6.sourceURI.spec, "http://localhost:" + gPort + "/addons/test_migrate4_6.xpi"); do_check_eq(a6.releaseNotesURI.spec, "http://example.com/updateInfo.xhtml"); do_check_false(a6.hasBinaryComponents); @@ -284,7 +273,6 @@ function test_results() { do_check_true(a7.isActive); do_check_eq(a7.applyBackgroundUpdates, AddonManager.AUTOUPDATE_DEFAULT); do_check_false(a7.foreignInstall); - do_check_true(a7.seen); do_check_eq(a7.sourceURI.spec, "http://localhost:" + gPort + "/addons/test_migrate4_7.xpi"); do_check_eq(a7.releaseNotesURI, null); do_check_false(a7.hasBinaryComponents); @@ -296,7 +284,6 @@ function test_results() { do_check_false(a8.appDisabled); do_check_true(a8.isActive); do_check_false(a8.foreignInstall); - do_check_true(a8.seen); do_check_true(a8.hasBinaryComponents); do_check_false(a8.strictCompatibility); @@ -306,7 +293,6 @@ function test_results() { do_check_false(a9.appDisabled); do_check_true(a9.isActive); do_check_false(a9.foreignInstall); - do_check_true(a9.seen); do_check_false(a9.hasBinaryComponents); do_check_true(a9.strictCompatibility); |