mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 07:01:19 +00:00
Bug 1845305 - add tests for sandboxed iframe autocompletion r=dimi
Note the test fails, and the fix will be provided via the next patch in this stack. Differential Revision: https://phabricator.services.mozilla.com/D203240
This commit is contained in:
parent
071c853e6c
commit
497846017a
@ -4,6 +4,7 @@ support-files = [
|
||||
"./fathom/**",
|
||||
"../fixtures/autocomplete_basic.html",
|
||||
"../fixtures/autocomplete_iframe.html",
|
||||
"../fixtures/autocomplete_iframe_sandboxed.html",
|
||||
"../fixtures/autocomplete_simple_basic.html",
|
||||
"../fixtures/page_navigation.html",
|
||||
"./empty.html",
|
||||
@ -26,6 +27,8 @@ skip-if = [
|
||||
|
||||
["browser_autofill_duplicate_fields.js"]
|
||||
|
||||
["browser_autofill_sandboxed_iframe.js"]
|
||||
|
||||
["browser_check_installed.js"]
|
||||
|
||||
["browser_dropdown_layout.js"]
|
||||
|
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
|
||||
add_setup(async function () {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
["extensions.formautofill.addresses.capture.enabled", true],
|
||||
["extensions.formautofill.addresses.supported", "on"],
|
||||
],
|
||||
});
|
||||
await setStorage(TEST_ADDRESS_2, TEST_ADDRESS_3);
|
||||
});
|
||||
|
||||
add_task(async function test_autocomplete_in_sandboxed_iframe() {
|
||||
await BrowserTestUtils.withNewTab(
|
||||
{ gBrowser, url: FORM_IFRAME_SANDBOXED_URL },
|
||||
async browser => {
|
||||
const iframeBC = browser.browsingContext.children[0];
|
||||
await openPopupOnSubframe(browser, iframeBC, "#street-address");
|
||||
await BrowserTestUtils.synthesizeKey("VK_DOWN", {}, iframeBC);
|
||||
await BrowserTestUtils.synthesizeKey("VK_RETURN", {}, iframeBC);
|
||||
await waitForAutofill(
|
||||
iframeBC,
|
||||
"#street-address",
|
||||
TEST_ADDRESS_2["street-address"]
|
||||
);
|
||||
Assert.ok(true, "autocomplete works in sandboxed iframe");
|
||||
}
|
||||
);
|
||||
|
||||
await removeAllRecords();
|
||||
});
|
@ -45,6 +45,8 @@ const ADDRESS_FORM_WITH_PAGE_NAVIGATION_BUTTONS =
|
||||
"https://example.org" +
|
||||
HTTP_TEST_PATH +
|
||||
"address/capture_address_on_page_navigation.html";
|
||||
const FORM_IFRAME_SANDBOXED_URL =
|
||||
"https://example.org" + HTTP_TEST_PATH + "autocomplete_iframe_sandboxed.html";
|
||||
const CREDITCARD_FORM_URL =
|
||||
"https://example.org" +
|
||||
HTTP_TEST_PATH +
|
||||
|
11
browser/extensions/formautofill/test/fixtures/autocomplete_iframe_sandboxed.html
vendored
Normal file
11
browser/extensions/formautofill/test/fixtures/autocomplete_iframe_sandboxed.html
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Form Autofill With Remote IFrame Demo Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe src="https://test1.example.com:443/browser/browser/extensions/formautofill/test/browser/autocomplete_basic.html" sandbox width="400" height="400">
|
||||
</iframe>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user