diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js')
-rw-r--r-- | toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js b/toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js new file mode 100644 index 000000000..2a7b58f12 --- /dev/null +++ b/toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +/* + * Tests the requestAutocomplete user interface. + */ + +"use strict"; + +/** + * Open the requestAutocomplete UI and test that selecting a profile results in + * the correct data being sent back to the opener. + */ +add_task(function* test_select_profile() { + // Request an e-mail address. + let { uiWindow, promiseResult } = yield FormAutofillTest.showUI( + TestData.requestEmailOnly); + + // Accept the dialog. + let acceptButton = uiWindow.document.getElementById("accept"); + EventUtils.synthesizeMouseAtCenter(acceptButton, {}, uiWindow); + + let result = yield promiseResult; + Assert.equal(result.fields.length, 1); + Assert.equal(result.fields[0].section, ""); + Assert.equal(result.fields[0].addressType, ""); + Assert.equal(result.fields[0].contactType, ""); + Assert.equal(result.fields[0].fieldName, "email"); + Assert.equal(result.fields[0].value, "email@example.org"); +}); + +/** + * Open the requestAutocomplete UI and cancel the dialog. + */ +add_task(function* test_cancel() { + // Request an e-mail address. + let { uiWindow, promiseResult } = yield FormAutofillTest.showUI( + TestData.requestEmailOnly); + + // Cancel the dialog. + let acceptButton = uiWindow.document.getElementById("cancel"); + EventUtils.synthesizeMouseAtCenter(acceptButton, {}, uiWindow); + + let result = yield promiseResult; + Assert.ok(result.canceled); +}); + +add_task(terminationTaskFn); |