Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Unified Diff: chrome/browser/autofill/autofill_interactive_uitest.cc

Issue 2853623002: [refactor] Fix autofill features for payments when the form is inside an OOPIF (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/autofill/page_click_tracker_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_interactive_uitest.cc
diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc
index 155f9bf3a6a55939f96eae75c37a8cf02bf4fe87..cd67195ee1d913c3f0b79eb84e0632611a4cf2ee 100644
--- a/chrome/browser/autofill/autofill_interactive_uitest.cc
+++ b/chrome/browser/autofill/autofill_interactive_uitest.cc
@@ -1830,4 +1830,40 @@ IN_PROC_BROWSER_TEST_F(AutofillInteractiveIsolationTest,
EXPECT_EQ("Milton", value);
}
+// This test verifies that credit card (payment card list) popup works when the
+// form is inside an OOPIF.
+IN_PROC_BROWSER_TEST_F(AutofillInteractiveTest, CrossSitePaymentForms) {
+ // Ensure that |embedded_test_server()| serves both domains used below.
+ host_resolver()->AddRule("*", "127.0.0.1");
+
+ // Main frame is on a.com, iframe is on b.com.
+ GURL url = embedded_test_server()->GetURL(
+ "a.com", "/autofill/cross_origin_iframe.html");
+ ui_test_utils::NavigateToURL(browser(), url);
+ GURL iframe_url = embedded_test_server()->GetURL(
+ "b.com", "/autofill/autofill_creditcard_form.html");
+ EXPECT_TRUE(
+ content::NavigateIframeToURL(GetWebContents(), "crossFrame", iframe_url));
+
+ // Let |test_delegate()| also observe autofill events in the iframe.
+ content::RenderFrameHost* cross_frame =
+ RenderFrameHostForName(GetWebContents(), "crossFrame");
+ ASSERT_TRUE(cross_frame);
+ ContentAutofillDriver* cross_driver =
+ ContentAutofillDriverFactory::FromWebContents(GetWebContents())
+ ->DriverForFrame(cross_frame);
+ ASSERT_TRUE(cross_driver);
+ cross_driver->autofill_manager()->SetTestDelegate(test_delegate());
+
+ // Focus the form in the iframe and simulate choosing a suggestion via
+ // keyboard.
+ std::string script_focus(
+ "window.focus();"
+ "document.getElementById('CREDIT_CARD_NUMBER').focus();");
+ ASSERT_TRUE(content::ExecuteScript(cross_frame, script_focus));
+
+ // Send an arrow dow keypress in order to trigger the autofill popup.
+ SendKeyToPageAndWait(ui::DomKey::ARROW_DOWN);
+}
+
} // namespace autofill
« no previous file with comments | « no previous file | chrome/renderer/autofill/page_click_tracker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698