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

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

Issue 1006743002: Autofill: Improve table row matching algorithm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 5 years, 9 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/test/data/autofill/heuristics/output/09_register_ecomm.dell.com.out » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/autofill/form_autofill_browsertest.cc
diff --git a/chrome/renderer/autofill/form_autofill_browsertest.cc b/chrome/renderer/autofill/form_autofill_browsertest.cc
index 24b5f05cab1403664b768f7bb2980e89b9657201..0032cf071b3b3c9644b07bc30bae8504d2ae6244 100644
--- a/chrome/renderer/autofill/form_autofill_browsertest.cc
+++ b/chrome/renderer/autofill/form_autofill_browsertest.cc
@@ -3094,18 +3094,38 @@ TEST_F(FormAutofillTest, LabelsInferredFromTableAdjacentElements) {
TEST_F(FormAutofillTest, LabelsInferredFromTableRow) {
std::vector<base::string16> labels, names, values;
- labels.push_back(ASCIIToUTF16("*First Name *Last Name *Email"));
+ labels.push_back(ASCIIToUTF16("*First Name"));
names.push_back(ASCIIToUTF16("firstname"));
values.push_back(ASCIIToUTF16("John"));
- labels.push_back(ASCIIToUTF16("*First Name *Last Name *Email"));
+ labels.push_back(ASCIIToUTF16("*Last Name"));
names.push_back(ASCIIToUTF16("lastname"));
values.push_back(ASCIIToUTF16("Smith"));
- labels.push_back(ASCIIToUTF16("*First Name *Last Name *Email"));
+ labels.push_back(ASCIIToUTF16("*Email"));
names.push_back(ASCIIToUTF16("email"));
values.push_back(ASCIIToUTF16("john@example.com"));
+ labels.push_back(ASCIIToUTF16("NAME"));
+ names.push_back(ASCIIToUTF16("name2"));
+ values.push_back(ASCIIToUTF16("John Smith"));
+
+ labels.push_back(ASCIIToUTF16("EMAIL"));
+ names.push_back(ASCIIToUTF16("email2"));
+ values.push_back(ASCIIToUTF16("john@example2.com"));
+
+ labels.push_back(ASCIIToUTF16("Phone"));
+ names.push_back(ASCIIToUTF16("phone1"));
+ values.push_back(ASCIIToUTF16("123"));
+
+ labels.push_back(ASCIIToUTF16("Phone"));
+ names.push_back(ASCIIToUTF16("phone2"));
+ values.push_back(ASCIIToUTF16("456"));
+
+ labels.push_back(ASCIIToUTF16("Phone"));
+ names.push_back(ASCIIToUTF16("phone3"));
+ values.push_back(ASCIIToUTF16("7890"));
+
ExpectLabels(
"<FORM name='TestForm' action='http://cnn.com' method='post'>"
"<TABLE>"
@@ -3126,6 +3146,32 @@ TEST_F(FormAutofillTest, LabelsInferredFromTableRow) {
" </TD>"
" </TR>"
" <TR>"
+ " <TD colspan='2'>NAME</TD>"
+ " <TD>EMAIL</TD>"
+ " </TR>"
+ " <TR>"
+ " <TD colspan='2'>"
+ " <INPUT type='text' id='name2' value='John Smith'/>"
+ " </TD>"
+ " <TD>"
+ " <INPUT type='text' id='email2' value='john@example2.com'/>"
+ " </TD>"
+ " </TR>"
+ " <TR>"
+ " <TD>Phone</TD>"
+ " </TR>"
+ " <TR>"
+ " <TD>"
+ " <INPUT type='text' id='phone1' value='123'/>"
+ " </TD>"
+ " <TD>"
+ " <INPUT type='text' id='phone2' value='456'/>"
+ " </TD>"
+ " <TD>"
+ " <INPUT type='text' id='phone3' value='7890'/>"
+ " </TD>"
+ " </TR>"
+ " <TR>"
" <TD>"
" <INPUT type='submit' name='reply-send' value='Send'/>"
" </TD>"
« no previous file with comments | « no previous file | chrome/test/data/autofill/heuristics/output/09_register_ecomm.dell.com.out » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698