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

Unified Diff: chrome/browser/autocomplete_history_manager_unittest.cc

Issue 7576001: Refactor webkit_glue::FormField to remove hacky methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix copyright header Created 9 years, 4 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/browser/autofill/address_field_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete_history_manager_unittest.cc
diff --git a/chrome/browser/autocomplete_history_manager_unittest.cc b/chrome/browser/autocomplete_history_manager_unittest.cc
index cf5dae09c9b7cab9f883a46b753eb5a267b50002..5535b4416794a68203f55f0fd0494a3f0a3366f1 100644
--- a/chrome/browser/autocomplete_history_manager_unittest.cc
+++ b/chrome/browser/autocomplete_history_manager_unittest.cc
@@ -58,12 +58,11 @@ TEST_F(AutocompleteHistoryManagerTest, CreditCardNumberValue) {
form.user_submitted = true;
// Valid Visa credit card number pulled from the paypal help site.
- webkit_glue::FormField valid_cc(ASCIIToUTF16("Credit Card"),
- ASCIIToUTF16("ccnum"),
- ASCIIToUTF16("4012888888881881"),
- ASCIIToUTF16("text"),
- 20,
- false);
+ webkit_glue::FormField valid_cc;
+ valid_cc.label = ASCIIToUTF16("Credit Card");
+ valid_cc.name = ASCIIToUTF16("ccnum");
+ valid_cc.value = ASCIIToUTF16("4012888888881881");
+ valid_cc.form_control_type = ASCIIToUTF16("text");
form.fields.push_back(valid_cc);
EXPECT_CALL(*web_data_service_, AddFormFields(_)).Times(0);
@@ -82,12 +81,11 @@ TEST_F(AutocompleteHistoryManagerTest, NonCreditCardNumberValue) {
form.user_submitted = true;
// Invalid credit card number.
- webkit_glue::FormField invalid_cc(ASCIIToUTF16("Credit Card"),
- ASCIIToUTF16("ccnum"),
- ASCIIToUTF16("4580123456789012"),
- ASCIIToUTF16("text"),
- 20,
- false);
+ webkit_glue::FormField invalid_cc;
+ invalid_cc.label = ASCIIToUTF16("Credit Card");
+ invalid_cc.name = ASCIIToUTF16("ccnum");
+ invalid_cc.value = ASCIIToUTF16("4580123456789012");
+ invalid_cc.form_control_type = ASCIIToUTF16("text");
form.fields.push_back(invalid_cc);
EXPECT_CALL(*(web_data_service_.get()), AddFormFields(_)).Times(1);
@@ -103,12 +101,11 @@ TEST_F(AutocompleteHistoryManagerTest, SSNValue) {
form.action = GURL("http://myform.com/submit.html");
form.user_submitted = true;
- webkit_glue::FormField ssn(ASCIIToUTF16("Social Security Number"),
- ASCIIToUTF16("ssn"),
- ASCIIToUTF16("078-05-1120"),
- ASCIIToUTF16("text"),
- 20,
- false);
+ webkit_glue::FormField ssn;
+ ssn.label = ASCIIToUTF16("Social Security Number");
+ ssn.name = ASCIIToUTF16("ssn");
+ ssn.value = ASCIIToUTF16("078-05-1120");
+ ssn.form_control_type = ASCIIToUTF16("text");
form.fields.push_back(ssn);
EXPECT_CALL(*web_data_service_, AddFormFields(_)).Times(0);
@@ -124,13 +121,12 @@ TEST_F(AutocompleteHistoryManagerTest, SearchField) {
form.action = GURL("http://myform.com/submit.html");
form.user_submitted = true;
- // Invalid credit card number.
- webkit_glue::FormField search_field(ASCIIToUTF16("Search"),
- ASCIIToUTF16("search"),
- ASCIIToUTF16("my favorite query"),
- ASCIIToUTF16("search"),
- 20,
- false);
+ // Search field.
+ webkit_glue::FormField search_field;
+ search_field.label = ASCIIToUTF16("Search");
+ search_field.name = ASCIIToUTF16("search");
+ search_field.value = ASCIIToUTF16("my favorite query");
+ search_field.form_control_type = ASCIIToUTF16("search");
form.fields.push_back(search_field);
EXPECT_CALL(*(web_data_service_.get()), AddFormFields(_)).Times(1);
« no previous file with comments | « no previous file | chrome/browser/autofill/address_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698