diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-06-26 16:09:08 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-06-26 16:09:08 -0400 |
commit | eda567b364a06e9e63efb865a6b1c73f1cb5232e (patch) | |
tree | 912ab15d877f733318e2c0394713bca33b830547 /toolkit/mozapps/webextensions/test/xpcshell/test_corruptfile.js | |
parent | 80eb356d57fc310cdf812cae63de30d6e56c1788 (diff) | |
download | UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.gz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.lz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.tar.xz UXP-eda567b364a06e9e63efb865a6b1c73f1cb5232e.zip |
[AllAM] Remove Mozilla Tests
Diffstat (limited to 'toolkit/mozapps/webextensions/test/xpcshell/test_corruptfile.js')
-rw-r--r-- | toolkit/mozapps/webextensions/test/xpcshell/test_corruptfile.js | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/toolkit/mozapps/webextensions/test/xpcshell/test_corruptfile.js b/toolkit/mozapps/webextensions/test/xpcshell/test_corruptfile.js deleted file mode 100644 index 92b375850..000000000 --- a/toolkit/mozapps/webextensions/test/xpcshell/test_corruptfile.js +++ /dev/null @@ -1,83 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -// Tests that attempting to install a corrupt XPI file doesn't break the universe - -const profileDir = gProfD.clone(); -profileDir.append("extensions"); - -function run_test() { - createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1"); - - startupManager(); - - if (TEST_UNPACKED) - run_test_unpacked(); - else - run_test_packed(); -} - -// When installing packed we won't detect corruption in the XPI until we attempt -// to load bootstrap.js so everything will look normal from the outside. -function run_test_packed() { - do_test_pending(); - - prepare_test({ - "corrupt@tests.mozilla.org": [ - ["onInstalling", false], - ["onInstalled", false] - ] - }, [ - "onNewInstall", - "onInstallStarted", - "onInstallEnded" - ]); - - installAllFiles([do_get_file("data/corruptfile.xpi")], function() { - ensure_test_completed(); - - AddonManager.getAddonByID("corrupt@tests.mozilla.org", function(addon) { - do_check_neq(addon, null); - - do_test_finished(); - }); - }); -} - -// When extracting the corruption will be detected and the add-on fails to -// install -function run_test_unpacked() { - do_test_pending(); - - prepare_test({ - "corrupt@tests.mozilla.org": [ - ["onInstalling", false], - "onOperationCancelled" - ] - }, [ - "onNewInstall", - "onInstallStarted", - "onInstallFailed" - ]); - - installAllFiles([do_get_file("data/corruptfile.xpi")], function() { - ensure_test_completed(); - - // Check the add-on directory isn't left over - var addonDir = profileDir.clone(); - addonDir.append("corrupt@tests.mozilla.org"); - pathShouldntExist(addonDir); - - // Check the staging directory isn't left over - var stageDir = profileDir.clone(); - stageDir.append("staged"); - pathShouldntExist(stageDir); - - AddonManager.getAddonByID("corrupt@tests.mozilla.org", function(addon) { - do_check_eq(addon, null); - - do_test_finished(); - }); - }); -} |