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

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

Issue 686653003: Don't use FormFieldData only as a key in a map (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/password_autofill_agent_browsertest.cc
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
index 4e60b376d57f025ed61b392f32d3b47c43627e3f..bd5c991b66d4f2a6823cf290d95914691b7330d3 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -37,6 +37,8 @@ using blink::WebView;
namespace {
+const int kPasswordFillFormDataId = 1234;
+
// The name of the username/password element in the form.
const char kUsernameName[] = "username";
const char kPasswordName[] = "password";
@@ -176,7 +178,7 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
// protected.
void SimulateOnFillPasswordForm(
const PasswordFormFillData& fill_data) {
- AutofillMsg_FillPasswordForm msg(0, fill_data);
+ AutofillMsg_FillPasswordForm msg(0, kPasswordFillFormDataId, fill_data);
static_cast<content::RenderViewObserver*>(password_autofill_agent_)
->OnMessageReceived(msg);
}
@@ -426,13 +428,13 @@ class PasswordAutofillAgentTest : public ChromeRenderViewTest {
render_thread_->sink().GetFirstMessageMatching(
AutofillHostMsg_ShowPasswordSuggestions::ID);
EXPECT_TRUE(message);
- Tuple4<autofill::FormFieldData, base::string16, bool, gfx::RectF> args;
+ Tuple5<int, base::i18n::TextDirection, base::string16, bool, gfx::RectF>
+ args;
AutofillHostMsg_ShowPasswordSuggestions::Read(message, &args);
EXPECT_EQ(2u, fill_data_.basic_data.fields.size());
- EXPECT_EQ(fill_data_.basic_data.fields[0].name, args.a.name);
- EXPECT_EQ(ASCIIToUTF16(username), args.a.value);
- EXPECT_EQ(ASCIIToUTF16(username), args.b);
- EXPECT_EQ(show_all, args.c);
+ EXPECT_EQ(kPasswordFillFormDataId, args.a);
+ EXPECT_EQ(ASCIIToUTF16(username), args.c);
+ EXPECT_EQ(show_all, args.d);
render_thread_->sink().ClearMessages();
}

Powered by Google App Engine
This is Rietveld 408576698