Index: chrome/renderer/form_manager_unittest.cc |
diff --git a/chrome/renderer/form_manager_unittest.cc b/chrome/renderer/form_manager_unittest.cc |
index 74d25bef153d4b6a312b357cfb89fa996a587153..01dc52a683f87dc070cb533e350dc96b0aa463b4 100644 |
--- a/chrome/renderer/form_manager_unittest.cc |
+++ b/chrome/renderer/form_manager_unittest.cc |
@@ -56,13 +56,13 @@ TEST_F(FormManagerTest, WebFormElementToFormData) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -100,13 +100,13 @@ TEST_F(FormManagerTest, ExtractForms) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -148,7 +148,7 @@ TEST_F(FormManagerTest, ExtractMultipleForms) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -169,14 +169,14 @@ TEST_F(FormManagerTest, ExtractMultipleForms) { |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
- fields2[0]); |
+ 20), |
+ fields2[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("second"), |
ASCIIToUTF16("Submit"), |
ASCIIToUTF16("submit"), |
0), |
- fields2[1]); |
+ fields2[1]); |
} |
TEST_F(FormManagerTest, GetFormsAutocomplete) { |
@@ -232,7 +232,7 @@ TEST_F(FormManagerTest, GetFormsAutocomplete) { |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply"), |
@@ -271,7 +271,7 @@ TEST_F(FormManagerTest, GetFormsElementsEnabled) { |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("submit"), |
@@ -317,13 +317,13 @@ TEST_F(FormManagerTest, FindForm) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -369,13 +369,13 @@ TEST_F(FormManagerTest, FillForm) { |
ASCIIToUTF16("firstname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -403,20 +403,20 @@ TEST_F(FormManagerTest, FillForm) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("Wyatt"), |
ASCIIToUTF16("text"), |
- 0), |
- fields2[0]); |
+ 20), |
+ fields2[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Earp"), |
ASCIIToUTF16("text"), |
- 0), |
- fields2[1]); |
+ 20), |
+ fields2[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
ASCIIToUTF16("Send"), |
ASCIIToUTF16("submit"), |
0), |
- fields2[2]); |
+ fields2[2]); |
} |
TEST_F(FormManagerTest, Reset) { |
@@ -474,13 +474,13 @@ TEST_F(FormManagerTest, Labels) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Last name:"), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -520,13 +520,13 @@ TEST_F(FormManagerTest, LabelsWithSpans) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Last name:"), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -570,13 +570,13 @@ TEST_F(FormManagerTest, InvalidLabels) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -621,13 +621,13 @@ TEST_F(FormManagerTest, OneLabelElementFirstControlElementDisabled) { |
ASCIIToUTF16("middlename"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Last name:"), |
ASCIIToUTF16("lastname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -667,13 +667,13 @@ TEST_F(FormManagerTest, LabelsInferredFromText) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Last name:"), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -713,13 +713,13 @@ TEST_F(FormManagerTest, LabelsInferredFromParagraph) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Last name:"), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -770,13 +770,13 @@ TEST_F(FormManagerTest, LabelsInferredFromTableCell) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Last name:"), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -846,13 +846,13 @@ TEST_F(FormManagerTest, LabelsInferredFromTableCellNested) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("John"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Last name:"), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Smith"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -892,13 +892,13 @@ TEST_F(FormManagerTest, LabelsInferredWithSameName) { |
ASCIIToUTF16("Address"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("Address Line 2:"), |
ASCIIToUTF16("Address"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -948,31 +948,31 @@ TEST_F(FormManagerTest, LabelsInferredWithImageTags) { |
ASCIIToUTF16("dayphone1"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("-"), |
ASCIIToUTF16("dayphone2"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(ASCIIToUTF16("-"), |
ASCIIToUTF16("dayphone3"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[2]); |
EXPECT_EQ(FormField(ASCIIToUTF16("ext.:"), |
ASCIIToUTF16("dayphone4"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[3]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("dummy"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[4]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -1018,13 +1018,13 @@ TEST_F(FormManagerTest, FillFormMaxLength) { |
ASCIIToUTF16("firstname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -1053,14 +1053,14 @@ TEST_F(FormManagerTest, FillFormMaxLength) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("Broth"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[0]); |
EXPECT_EQ(ASCIIToUTF16("Broth"), fields2[0].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Jonat"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[1]); |
EXPECT_EQ(ASCIIToUTF16("Jonat"), fields2[1].value()); |
EXPECT_EQ(FormField(string16(), |
@@ -1110,13 +1110,13 @@ TEST_F(FormManagerTest, FillFormNegativeMaxLength) { |
ASCIIToUTF16("firstname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |
@@ -1146,14 +1146,14 @@ TEST_F(FormManagerTest, FillFormNegativeMaxLength) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("Brother"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[0]); |
EXPECT_EQ(ASCIIToUTF16("Brother"), fields2[0].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Jonathan"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[1]); |
EXPECT_EQ(ASCIIToUTF16("Jonathan"), fields2[1].value()); |
EXPECT_EQ(FormField(string16(), |
@@ -1200,28 +1200,28 @@ TEST_F(FormManagerTest, FillFormMoreFormDataFields) { |
ASCIIToUTF16("prefix"), |
string16(), |
ASCIIToUTF16("text"), |
- 0); |
+ 20); |
form->fields.insert(form->fields.begin(), field1); |
FormField field2(string16(), |
ASCIIToUTF16("hidden"), |
string16(), |
ASCIIToUTF16("text"), |
- 0); |
+ 20); |
form->fields.insert(form->fields.begin() + 2, field2); |
FormField field3(string16(), |
ASCIIToUTF16("second"), |
string16(), |
ASCIIToUTF16("text"), |
- 0); |
+ 20); |
form->fields.insert(form->fields.begin() + 4, field3); |
FormField field4(string16(), |
ASCIIToUTF16("postfix"), |
string16(), |
ASCIIToUTF16("text"), |
- 0); |
+ 20); |
form->fields.insert(form->fields.begin() + 6, field4); |
// Fill the form. |
@@ -1254,21 +1254,21 @@ TEST_F(FormManagerTest, FillFormMoreFormDataFields) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("Brother"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(ASCIIToUTF16("Brother"), fields[0].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("middlename"), |
ASCIIToUTF16("Joseph"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(ASCIIToUTF16("Joseph"), fields[1].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Jonathan"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[2]); |
EXPECT_EQ(ASCIIToUTF16("Jonathan"), fields[2].value()); |
EXPECT_EQ(FormField(string16(), |
@@ -1341,49 +1341,49 @@ TEST_F(FormManagerTest, FillFormFewerFormDataFields) { |
ASCIIToUTF16("prefix"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(string16(), fields[0].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("Brother"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(ASCIIToUTF16("Brother"), fields[1].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("hidden"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[2]); |
EXPECT_EQ(string16(), fields[2].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("middlename"), |
ASCIIToUTF16("Joseph"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[3]); |
EXPECT_EQ(ASCIIToUTF16("Joseph"), fields[3].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("second"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[4]); |
EXPECT_EQ(string16(), fields[4].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Jonathan"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[5]); |
EXPECT_EQ(ASCIIToUTF16("Jonathan"), fields[5].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("postfix"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[6]); |
EXPECT_EQ(string16(), fields[6].value()); |
EXPECT_EQ(FormField(string16(), |
@@ -1450,28 +1450,28 @@ TEST_F(FormManagerTest, FillFormExtraFieldInCache) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("Brother"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(ASCIIToUTF16("Brother"), fields[0].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("middlename"), |
ASCIIToUTF16("Joseph"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(ASCIIToUTF16("Joseph"), fields[1].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Jonathan"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[2]); |
EXPECT_EQ(ASCIIToUTF16("Jonathan"), fields[2].value()); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("postfix"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[3]); |
EXPECT_EQ(string16(), fields[3].value()); |
EXPECT_EQ(FormField(string16(), |
@@ -1518,13 +1518,13 @@ TEST_F(FormManagerTest, FillFormEmptyName) { |
ASCIIToUTF16("firstname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
string16(), |
@@ -1552,13 +1552,13 @@ TEST_F(FormManagerTest, FillFormEmptyName) { |
ASCIIToUTF16("firstname"), |
ASCIIToUTF16("Wyatt"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("lastname"), |
ASCIIToUTF16("Earp"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[1]); |
EXPECT_EQ(FormField(string16(), |
string16(), |
@@ -1610,13 +1610,13 @@ TEST_F(FormManagerTest, FillFormEmptyFormNames) { |
ASCIIToUTF16("apple"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("banana"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(string16(), |
string16(), |
@@ -1644,13 +1644,13 @@ TEST_F(FormManagerTest, FillFormEmptyFormNames) { |
ASCIIToUTF16("apple"), |
ASCIIToUTF16("Red"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[0]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("banana"), |
ASCIIToUTF16("Yellow"), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields2[1]); |
EXPECT_EQ(FormField(string16(), |
string16(), |
@@ -1696,25 +1696,25 @@ TEST_F(FormManagerTest, ThreePartPhone) { |
ASCIIToUTF16("dayphone1"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[0]); |
EXPECT_EQ(FormField(ASCIIToUTF16("-"), |
ASCIIToUTF16("dayphone2"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[1]); |
EXPECT_EQ(FormField(ASCIIToUTF16("-"), |
ASCIIToUTF16("dayphone3"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[2]); |
EXPECT_EQ(FormField(ASCIIToUTF16("ext.:"), |
ASCIIToUTF16("dayphone4"), |
string16(), |
ASCIIToUTF16("text"), |
- 0), |
+ 20), |
fields[3]); |
EXPECT_EQ(FormField(string16(), |
ASCIIToUTF16("reply-send"), |