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

Unified Diff: chrome/renderer/autofill/autofill_renderer_browsertest.cc

Issue 1059393002: Remove --respect-autocomplete-off-autofill flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix last 3 tests Created 5 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
Index: chrome/renderer/autofill/autofill_renderer_browsertest.cc
diff --git a/chrome/renderer/autofill/autofill_renderer_browsertest.cc b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
index 49a836650042d691f806b7f5a4ac62ecccb835db..0ff5d278a96321e89ebb1152f26faae245971380 100644
--- a/chrome/renderer/autofill/autofill_renderer_browsertest.cc
+++ b/chrome/renderer/autofill/autofill_renderer_browsertest.cc
@@ -36,11 +36,8 @@ using blink::WebVector;
namespace autofill {
-typedef Tuple<int,
- autofill::FormData,
- autofill::FormFieldData,
- gfx::RectF,
- bool> AutofillQueryParam;
+typedef Tuple<int, autofill::FormData, autofill::FormFieldData, gfx::RectF>
+ AutofillQueryParam;
class AutofillRendererTest : public ChromeRenderViewTest {
public:
@@ -187,54 +184,6 @@ TEST_F(AutofillRendererTest, EnsureNoFormSeenIfTooFewFields) {
ASSERT_EQ(0UL, forms.size());
}
-TEST_F(AutofillRendererTest, ShowAutofillWarning) {
- LoadHTML("<form method='POST' autocomplete='Off'>"
- " <input id='firstname' autocomplete='OFF'/>"
- " <input id='middlename'/>"
- " <input id='lastname'/>"
- "</form>");
-
- // Verify that "QueryFormFieldAutofill" isn't sent prior to a user
- // interaction.
- const IPC::Message* message0 = render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_QueryFormFieldAutofill::ID);
- EXPECT_EQ(nullptr, message0);
-
- WebFrame* web_frame = GetMainFrame();
- WebDocument document = web_frame->document();
- WebInputElement firstname =
- document.getElementById("firstname").to<WebInputElement>();
- WebInputElement middlename =
- document.getElementById("middlename").to<WebInputElement>();
-
- // Simulate attempting to Autofill the form from the first element, which
- // specifies autocomplete="off". This should still trigger an IPC which
- // shouldn't display warnings.
- static_cast<PageClickListener*>(autofill_agent_)
- ->FormControlElementClicked(firstname, true);
- const IPC::Message* message1 = render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_QueryFormFieldAutofill::ID);
- EXPECT_NE(nullptr, message1);
-
- AutofillQueryParam query_param;
- AutofillHostMsg_QueryFormFieldAutofill::Read(message1, &query_param);
- EXPECT_FALSE(get<4>(query_param));
- render_thread_->sink().ClearMessages();
-
- // Simulate attempting to Autofill the form from the second element, which
- // does not specify autocomplete="off". This should trigger an IPC that will
- // show warnings, as we *do* show warnings for elements that don't themselves
- // set autocomplete="off", but for which the form does.
- static_cast<PageClickListener*>(autofill_agent_)
- ->FormControlElementClicked(middlename, true);
- const IPC::Message* message2 = render_thread_->sink().GetFirstMessageMatching(
- AutofillHostMsg_QueryFormFieldAutofill::ID);
- ASSERT_NE(nullptr, message2);
-
- AutofillHostMsg_QueryFormFieldAutofill::Read(message2, &query_param);
- EXPECT_TRUE(get<4>(query_param));
-}
-
// Regression test for [ http://crbug.com/346010 ].
TEST_F(AutofillRendererTest, DontCrashWhileAssociatingForms) {
LoadHTML("<form id='form'>"
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/renderer/autofill/form_autofill_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698