diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
commit | 0ddd00f1959c78ce37c14fef3c83401408fca3bf (patch) | |
tree | d408e02767c86cf8aac3acbb86722b03c77ede6f /toolkit/components/formautofill/test/xpcshell | |
parent | 20f0905b33cbb18d1caa80c55e2f552c2e18957b (diff) | |
download | UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.gz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.lz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.xz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.zip |
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/formautofill/test/xpcshell')
6 files changed, 0 insertions, 208 deletions
diff --git a/toolkit/components/formautofill/test/xpcshell/.eslintrc.js b/toolkit/components/formautofill/test/xpcshell/.eslintrc.js deleted file mode 100644 index d35787cd2..000000000 --- a/toolkit/components/formautofill/test/xpcshell/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -module.exports = { - "extends": [ - "../../../../../testing/xpcshell/xpcshell.eslintrc.js" - ] -}; diff --git a/toolkit/components/formautofill/test/xpcshell/head.js b/toolkit/components/formautofill/test/xpcshell/head.js deleted file mode 100644 index 1cee023f2..000000000 --- a/toolkit/components/formautofill/test/xpcshell/head.js +++ /dev/null @@ -1,23 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* - * Initialization specific to Form Autofill xpcshell tests. - * - * This file is loaded by "loader.js". - */ - -"use strict"; - -// The testing framework is fully initialized at this point, you can add -// xpcshell specific test initialization here. If you need shared functions or -// initialization that are not specific to xpcshell, consider adding them to -// "head_common.js" in the parent folder instead. - -add_task_in_parent_process(function* test_xpcshell_initialize_profile() { - // We need to send the profile-after-change notification manually to the - // startup component to ensure it has been initialized. - Cc["@mozilla.org/formautofill/startup;1"] - .getService(Ci.nsIObserver) - .observe(null, "profile-after-change", ""); -}); diff --git a/toolkit/components/formautofill/test/xpcshell/loader.js b/toolkit/components/formautofill/test/xpcshell/loader.js deleted file mode 100644 index 449989c8a..000000000 --- a/toolkit/components/formautofill/test/xpcshell/loader.js +++ /dev/null @@ -1,46 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* - * Infrastructure for the xpcshell tests located in this folder. - * - * See "loader_common.js" in the parent folder for a general overview. - * - * Unless you are adding new features to the framework, you shouldn't have to - * modify this file. Use "head_common.js" or "head.js" for shared code. - */ - -"use strict"; - -var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); -Cu.import("resource://gre/modules/Services.jsm", this); - -Services.scriptloader.loadSubScript( - Services.io.newFileURI(do_get_file("loader_common.js")).spec, this); - -// Define output functions so they look the same across all frameworks. -var Output = { - print: do_print, -}; - -var executeSoon = do_execute_soon; -var setTimeout = (fn, delay) => do_timeout(delay, fn); - -// Define task registration functions, see description in "loader_common.js". -var add_task_in_parent_process = add_task; -var add_task_in_child_process = function () {}; -var add_task_in_both_processes = add_task; - -Services.scriptloader.loadSubScript( - Services.io.newFileURI(do_get_file("head_common.js")).spec, this); - -// Tests are always run asynchronously and with the profile loaded. -function run_test() { - do_get_profile(); - run_next_test(); -} - -// Reminder: unless you are adding new features to the framework, you shouldn't -// have to modify this file. Use "head_common.js" or "head.js" for shared code. diff --git a/toolkit/components/formautofill/test/xpcshell/test_infrastructure.js b/toolkit/components/formautofill/test/xpcshell/test_infrastructure.js deleted file mode 100644 index af27cfdb5..000000000 --- a/toolkit/components/formautofill/test/xpcshell/test_infrastructure.js +++ /dev/null @@ -1,48 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* - * Tests the local testing infrastructure. - */ - -"use strict"; - -/** - * Tests the truth assertion function. - */ -add_task(function* test_assert_truth() { - Assert.ok(1 != 2); -}); - -/** - * Tests the equality assertion function. - */ -add_task(function* test_assert_equality() { - Assert.equal(1 + 1, 2); -}); - -/** - * Uses some of the utility functions provided by the framework. - */ -add_task(function* test_utility_functions() { - // The "print" function is useful to log information that is not known before. - let randomString = "R" + Math.floor(Math.random() * 10); - Output.print("The random contents will be '" + randomString + "'."); - - // Create the text file with the random contents. - let path = yield TestUtils.getTempFile("test-infrastructure.txt"); - yield OS.File.writeAtomic(path, new TextEncoder().encode(randomString)); - - // Test a few utility functions. - yield TestUtils.waitForTick(); - yield TestUtils.waitMs(50); - - let promiseMyNotification = TestUtils.waitForNotification("my-topic"); - Services.obs.notifyObservers(null, "my-topic", ""); - yield promiseMyNotification; - - // Check the file size. The file will be deleted automatically later. - Assert.equal((yield OS.File.stat(path)).size, randomString.length); -}); - -add_task(terminationTaskFn); diff --git a/toolkit/components/formautofill/test/xpcshell/test_integration.js b/toolkit/components/formautofill/test/xpcshell/test_integration.js deleted file mode 100644 index 7707f3880..000000000 --- a/toolkit/components/formautofill/test/xpcshell/test_integration.js +++ /dev/null @@ -1,72 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -/* - * Tests overriding the FormAutofillIntegration module functions. - */ - -"use strict"; - -/** - * The requestAutocomplete UI will not be displayed during these tests. - */ -add_task_in_parent_process(function* test_initialize() { - FormAutofillTest.requestAutocompleteResponse = { canceled: true }; -}); - -/** - * Registers and unregisters an integration override function. - */ -add_task(function* test_integration_override() { - let overrideCalled = false; - - let newIntegrationFn = base => ({ - createRequestAutocompleteUI: Task.async(function* () { - overrideCalled = true; - return yield base.createRequestAutocompleteUI.apply(this, arguments); - }), - }); - - FormAutofill.registerIntegration(newIntegrationFn); - try { - let ui = yield FormAutofill.integration.createRequestAutocompleteUI({}); - let result = yield ui.show(); - Assert.ok(result.canceled); - } finally { - FormAutofill.unregisterIntegration(newIntegrationFn); - } - - Assert.ok(overrideCalled); -}); - -/** - * Registers an integration override function that throws an exception, and - * ensures that this does not block other functions from being registered. - */ -add_task(function* test_integration_override_error() { - let overrideCalled = false; - - let errorIntegrationFn = base => { throw "Expected error." }; - - let newIntegrationFn = base => ({ - createRequestAutocompleteUI: Task.async(function* () { - overrideCalled = true; - return yield base.createRequestAutocompleteUI.apply(this, arguments); - }), - }); - - FormAutofill.registerIntegration(errorIntegrationFn); - FormAutofill.registerIntegration(newIntegrationFn); - try { - let ui = yield FormAutofill.integration.createRequestAutocompleteUI({}); - let result = yield ui.show(); - Assert.ok(result.canceled); - } finally { - FormAutofill.unregisterIntegration(errorIntegrationFn); - FormAutofill.unregisterIntegration(newIntegrationFn); - } - - Assert.ok(overrideCalled); -}); - -add_task(terminationTaskFn); diff --git a/toolkit/components/formautofill/test/xpcshell/xpcshell.ini b/toolkit/components/formautofill/test/xpcshell/xpcshell.ini deleted file mode 100644 index 711c03399..000000000 --- a/toolkit/components/formautofill/test/xpcshell/xpcshell.ini +++ /dev/null @@ -1,12 +0,0 @@ -[DEFAULT] -head = loader.js head.js -tail = -skip-if = toolkit == 'android' -# The following files starting with ".." are installed in the current folder. -# However, they cannot be referenced directly in the "head" directive above. -support-files = - ../head_common.js - ../loader_common.js - -[test_infrastructure.js] -[test_integration.js] |