diff --git a/browser/base/content/test/webextensions/browser.ini b/browser/base/content/test/webextensions/browser.ini index 66d49a4fc761..c1e2838cc4de 100644 --- a/browser/base/content/test/webextensions/browser.ini +++ b/browser/base/content/test/webextensions/browser.ini @@ -2,7 +2,6 @@ support-files = head.js file_install_extensions.html - browser_legacy.xpi browser_legacy_webext.xpi browser_webext_permissions.xpi browser_webext_nopermissions.xpi diff --git a/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js b/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js index dd813f012381..e9b1eb09feed 100644 --- a/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js +++ b/browser/base/content/test/webextensions/browser_extension_update_background_noprompt.js @@ -1,7 +1,6 @@ const {AddonManagerPrivate} = ChromeUtils.import("resource://gre/modules/AddonManager.jsm", {}); const ID_PERMS = "update_perms@tests.mozilla.org"; -const ID_LEGACY = "legacy_update@tests.mozilla.org"; const ID_ORIGINS = "update_origins@tests.mozilla.org"; function getBadgeStatus() { @@ -80,11 +79,6 @@ async function testNoPrompt(origUrl, id) { add_task(() => testNoPrompt(`${BASE}/browser_webext_update_perms1.xpi`, ID_PERMS)); -// Test that an update from a legacy extension to a webextension -// doesn't show a prompt even when the webextension uses -// promptable required permissions. -add_task(() => testNoPrompt(`${BASE}/browser_legacy.xpi`, ID_LEGACY)); - // Test that an update that narrows origin permissions is just applied without // showing a notification promt add_task(() => testNoPrompt(`${BASE}/browser_webext_update_origins1.xpi`, diff --git a/browser/base/content/test/webextensions/browser_legacy.xpi b/browser/base/content/test/webextensions/browser_legacy.xpi deleted file mode 100644 index da4b3062796c..000000000000 Binary files a/browser/base/content/test/webextensions/browser_legacy.xpi and /dev/null differ diff --git a/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js b/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js index 46a0894d7db5..fe95a7fadbd5 100644 --- a/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js +++ b/browser/base/content/test/webextensions/browser_update_interactive_noprompt.js @@ -51,11 +51,6 @@ async function testUpdateNoPrompt(filename, id, await addon.uninstall(); } -// Test that we don't see a prompt when updating from a legacy -// extension to a webextension. -add_task(() => testUpdateNoPrompt("browser_legacy.xpi", - "legacy_update@tests.mozilla.org", "1.1")); - // Test that we don't see a prompt when no new promptable permissions // are added. add_task(() => testUpdateNoPrompt("browser_webext_update_perms1.xpi", diff --git a/devtools/client/aboutdebugging/test/browser.ini b/devtools/client/aboutdebugging/test/browser.ini index 8ee48029be5c..b3809f5bb445 100644 --- a/devtools/client/aboutdebugging/test/browser.ini +++ b/devtools/client/aboutdebugging/test/browser.ini @@ -23,6 +23,8 @@ support-files = !/devtools/client/shared/test/telemetry-test-helpers.js [browser_addons_debug_bootstrapped.js] +# To be removed in bug 1497264 +skip-if = true [browser_addons_debug_info.js] [browser_addons_debug_webextension.js] tags = webextensions @@ -34,11 +36,16 @@ tags = webextensions skip-if = (verify && debug) || (debug && os == "linux" && bits == 64) # verify: crashes on shutdown, timeouts linux debug Bug 1299001 tags = webextensions [browser_addons_debugging_initial_state.js] +# To be removed or updated in bug 1497264 +skip-if = true [browser_addons_install.js] -skip-if = verify && debug +# To be updated in bug 1497264 (was "verify && debug") +skip-if = true [browser_addons_reload.js] [browser_addons_remove.js] [browser_addons_toggle_debug.js] +# To be removed or updated in bug 1497264 +skip-if = true [browser_page_not_found.js] [browser_service_workers.js] [browser_service_workers_fetch_flag.js] diff --git a/devtools/client/aboutdebugging/test/browser_addons_debug_info.js b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js index fb1814beda1f..eb43b72c5102 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_debug_info.js +++ b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js @@ -13,6 +13,8 @@ function testFilePath(container, expectedFilePath) { is(filePath.previousElementSibling.textContent, "Location", "file path has label"); } +// Remove in Bug 1497264 +/* add_task(async function testLegacyAddon() { const addonId = "test-devtools@mozilla.org"; const addonName = "test-devtools"; @@ -32,6 +34,7 @@ add_task(async function testLegacyAddon() { await closeAboutDebugging(tab); }); +*/ add_task(async function testWebExtension() { const addonId = "test-devtools-webextension-nobg@mozilla.org"; diff --git a/devtools/client/aboutdebugging/test/browser_addons_install.js b/devtools/client/aboutdebugging/test/browser_addons_install.js index ab779210ff64..420e306ca381 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_install.js +++ b/devtools/client/aboutdebugging/test/browser_addons_install.js @@ -7,9 +7,6 @@ loader.lazyImporter(this, "AddonTestUtils", AddonTestUtils.initMochitest(this); -const ADDON_ID = "test-devtools@mozilla.org"; -const ADDON_NAME = "test-devtools"; - function mockFilePicker(window, file) { // Mock the file picker to select a test addon const MockFilePicker = SpecialPowers.MockFilePicker; @@ -35,6 +32,9 @@ function promiseWriteWebManifestForExtension(manifest, dir) { } add_task(async function testLegacyInstallSuccess() { + const ADDON_ID = "test-devtools@mozilla.org"; + const ADDON_NAME = "test-devtools"; + const { tab, document } = await openAboutDebugging("addons"); await waitForInitialAddonList(document); diff --git a/devtools/client/aboutdebugging/test/browser_addons_reload.js b/devtools/client/aboutdebugging/test/browser_addons_reload.js index 16353be7d72f..a371a735dfde 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_reload.js +++ b/devtools/client/aboutdebugging/test/browser_addons_reload.js @@ -3,7 +3,6 @@ "use strict"; const ADDON_ID = "test-devtools@mozilla.org"; -const ADDON_NAME = "test-devtools"; const PACKAGED_ADDON_ID = "bug1273184@tests"; const PACKAGED_ADDON_NAME = "bug 1273184"; @@ -60,7 +59,10 @@ class TempWebExt { } } +// Remove in Bug 1497264 +/* add_task(async function reloadButtonReloadsAddon() { + const ADDON_NAME = "test-devtools"; const { tab, document, window } = await openAboutDebugging("addons"); const { AboutDebugging } = window; await waitForInitialAddonList(document); @@ -96,6 +98,7 @@ add_task(async function reloadButtonReloadsAddon() { await tearDownAddon(AboutDebugging, reloadedAddon); await closeAboutDebugging(tab); }); +*/ add_task(async function reloadButtonRefreshesMetadata() { const { tab, document, window } = await openAboutDebugging("addons"); diff --git a/devtools/client/aboutdebugging/test/browser_addons_remove.js b/devtools/client/aboutdebugging/test/browser_addons_remove.js index 27ed891b7b5f..f04a4a15719e 100644 --- a/devtools/client/aboutdebugging/test/browser_addons_remove.js +++ b/devtools/client/aboutdebugging/test/browser_addons_remove.js @@ -12,6 +12,8 @@ function getRemoveButton(document, id) { return document.querySelector(`[data-addon-id="${id}"] .uninstall-button`); } +// Remove in Bug 1497264 +/* add_task(async function removeLegacyExtension() { const addonID = "test-devtools@mozilla.org"; const addonName = "test-devtools"; @@ -36,6 +38,7 @@ add_task(async function removeLegacyExtension() { await closeAboutDebugging(tab); }); +*/ add_task(async function removeWebextension() { const addonID = "test-devtools-webextension@mozilla.org"; diff --git a/devtools/client/shared/test/browser.ini b/devtools/client/shared/test/browser.ini index d5cb61629d95..0f7448c06b84 100644 --- a/devtools/client/shared/test/browser.ini +++ b/devtools/client/shared/test/browser.ini @@ -77,7 +77,9 @@ support-files = [browser_cubic-bezier-06.js] [browser_cubic-bezier-07.js] [browser_dbg_addon-console.js] -skip-if = (e10s && debug || os == 'win' || verify) +# To be removed or updated in bug 1497264 +# previously was: (e10s && debug || os == 'win' || verify) +skip-if = true tags = addons [browser_dbg_debugger-statement.js] skip-if = e10s && debug @@ -245,7 +247,9 @@ skip-if = !e10s || os == "win" # RDM only works for remote tabs, Win: bug 140419 skip-if = verify [browser_theme_switching.js] [browser_dbg_listaddons.js] -skip-if = e10s && debug +# To be removed or updated in bug 1497264 +# previously was: e10s && debug +skip-if = true tags = addons [browser_dbg_listtabs-01.js] [browser_dbg_listtabs-02.js] diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_registry.js b/toolkit/mozapps/extensions/test/xpcshell/test_registry.js index 7068dab6b071..8e580293f389 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_registry.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_registry.js @@ -10,45 +10,20 @@ Services.prefs.setIntPref("extensions.enabledScopes", AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_USER + AddonManager.SCOPE_SYSTEM); -var addon1 = { - id: "addon1@tests.mozilla.org", - version: "1.0", - name: "Test 1", - bootstrap: true, - targetApplications: [{ - id: "xpcshell@tests.mozilla.org", - minVersion: "1", - maxVersion: "1", - }], -}; - -var addon2 = { - id: "addon2@tests.mozilla.org", - version: "2.0", - name: "Test 2", - bootstrap: true, - targetApplications: [{ - id: "xpcshell@tests.mozilla.org", - minVersion: "1", - maxVersion: "2", - }], -}; - -const IDS = ["addon1@tests.mozilla.org", - "addon2@tests.mozilla.org", - "addon3@tests.mozilla.org"]; - - -var addon1Dir; -var addon2Dir; -const addon3Dir = gProfD.clone(); -addon3Dir.append("addon3@tests.mozilla.org"); +const ID1 = "addon1@tests.mozilla.org"; +const ID2 = "addon2@tests.mozilla.org"; +let xpi1, xpi2; let registry; add_task(async function setup() { - addon1Dir = await promiseWriteInstallRDFForExtension(addon1, gProfD, "addon1"); - addon2Dir = await promiseWriteInstallRDFForExtension(addon2, gProfD, "addon2"); + xpi1 = await createTempWebExtensionFile({ + manifest: {applications: {gecko: {id: ID1}}}, + }); + + xpi2 = await createTempWebExtensionFile({ + manifest: {applications: {gecko: {id: ID2}}}, + }); registry = new MockRegistry(); registerCleanupFunction(() => { @@ -59,18 +34,15 @@ add_task(async function setup() { // Tests whether basic registry install works add_task(async function test_1() { registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, - "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon1@tests.mozilla.org", addon1Dir.path); + "SOFTWARE\\Mozilla\\XPCShell\\Extensions", + ID1, xpi1.path); registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon2@tests.mozilla.org", addon2Dir.path); - registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon3@tests.mozilla.org", addon3Dir.path); + ID2, xpi2.path); await promiseStartupManager(); - let [a1, a2, a3] = await AddonManager.getAddonsByIDs(IDS); + let [a1, a2] = await AddonManager.getAddonsByIDs([ID1, ID2]); notEqual(a1, null); ok(a1.isActive); ok(!hasFlag(a1.permissions, AddonManager.PERM_CAN_UNINSTALL)); @@ -80,48 +52,38 @@ add_task(async function test_1() { ok(a2.isActive); ok(!hasFlag(a2.permissions, AddonManager.PERM_CAN_UNINSTALL)); equal(a2.scope, AddonManager.SCOPE_USER); - - equal(a3, null); }); // Tests whether uninstalling from the registry works add_task(async function test_2() { registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon1@tests.mozilla.org", null); + ID1, null); registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon2@tests.mozilla.org", null); - registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon3@tests.mozilla.org", null); + ID2, null); await promiseRestartManager(); - let [a1, a2, a3] = await AddonManager.getAddonsByIDs(IDS); + let [a1, a2] = await AddonManager.getAddonsByIDs([ID1, ID2]); equal(a1, null); equal(a2, null); - equal(a3, null); }); // Checks that the ID in the registry must match that in the install manifest add_task(async function test_3() { registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon1@tests.mozilla.org", addon2Dir.path); + ID1, xpi2.path); registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon2@tests.mozilla.org", addon1Dir.path); - registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon3@tests.mozilla.org", addon3Dir.path); + ID2, xpi1.path); await promiseRestartManager(); - let [a1, a2, a3] = await AddonManager.getAddonsByIDs(IDS); + let [a1, a2] = await AddonManager.getAddonsByIDs([ID1, ID2]); equal(a1, null); equal(a2, null); - equal(a3, null); }); // Tests whether an extension's ID can change without its directory changing @@ -131,34 +93,30 @@ add_task(async function test_4() { registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon1@tests.mozilla.org", null); + ID1, null); registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon2@tests.mozilla.org", null); - registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, - "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon3@tests.mozilla.org", null); + ID2, null); await promiseRestartManager(); registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon1@tests.mozilla.org", addon1Dir.path); + ID1, xpi1.path); await promiseShutdownManager(); registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon1@tests.mozilla.org", null); + ID1, null); registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, "SOFTWARE\\Mozilla\\XPCShell\\Extensions", - "addon2@tests.mozilla.org", addon1Dir.path); - await promiseWriteInstallRDFForExtension(addon2, gProfD, "addon1"); + ID2, xpi1.path); + xpi2.copyTo(xpi1.parent, xpi1.leafName); await promiseStartupManager(); - let [a1, a2, a3] = await AddonManager.getAddonsByIDs(IDS); + let [a1, a2] = await AddonManager.getAddonsByIDs([ID1, ID2]); equal(a1, null); notEqual(a2, null); - equal(a3, null); }); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js b/toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js index ecaf8f501809..42bccfd055ba 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_trash_directory.js @@ -2,22 +2,12 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -const ADDONS = { - test_bootstrap1_1: { - "install.rdf": { - "id": "bootstrap1@tests.mozilla.org", - "name": "Test Bootstrap 1", - }, - "bootstrap.js": BOOTSTRAP_MONITOR_BOOTSTRAP_JS, - }, -}; - -add_task(async function setup() { +// Test that an open file inside the trash directory does not cause +// unrelated installs to break (see bug 1180901 for more background). +add_task(async function test() { createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); await promiseStartupManager(); -}); -add_task(async function() { let profileDir = OS.Constants.Path.profileDir; let trashDir = OS.Path.join(profileDir, "extensions", "trash"); let testFile = OS.Path.join(trashDir, "test.txt"); @@ -34,33 +24,13 @@ add_task(async function() { let fileExists = await OS.File.exists(testFile); ok(fileExists, "test.txt should have been created in " + trashDir); - let promiseInstallStatus = new Promise((resolve, reject) => { - let listener = { - onInstallFailed() { - AddonManager.removeInstallListener(listener); - reject("extension installation should not have failed"); - }, - onInstallEnded() { - AddonManager.removeInstallListener(listener); - ok(true, "extension installation should not have failed"); - resolve(); - }, - }; - - AddonManager.addInstallListener(listener); - }); - - await AddonTestUtils.promiseInstallXPI(ADDONS.test_bootstrap1_1); + await promiseInstallWebExtension({}); // The testFile should still exist at this point because we have not // yet closed the file handle and as a result, Windows cannot remove it. fileExists = await OS.File.exists(testFile); ok(fileExists, "test.txt should still exist"); - // Wait for the AddonManager to tell us if the installation of the extension - // succeeded or not. - await promiseInstallStatus; - // Cleanup await promiseShutdownManager(); await file.close();