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

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

Issue 6993053: Add <b> and <br> tags checking in infering labels. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix nit and test output. Created 9 years, 6 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/form_manager_browsertest.cc
diff --git a/chrome/renderer/autofill/form_manager_browsertest.cc b/chrome/renderer/autofill/form_manager_browsertest.cc
index a6f69a81f1b48fd236da834d8ebbe79cf5582327..70a41bf2064df3791476f33d7ef49f03fbf464b2 100644
--- a/chrome/renderer/autofill/form_manager_browsertest.cc
+++ b/chrome/renderer/autofill/form_manager_browsertest.cc
@@ -1119,6 +1119,32 @@ TEST_F(FormManagerTest, LabelsInferredFromParagraph) {
"</FORM>");
}
+TEST_F(FormManagerTest, LabelsInferredFromBold) {
+ ExpectJohnSmithLabels(
+ "<FORM name=\"TestForm\" action=\"http://cnn.com\" method=\"post\">"
+ " <B>First name:</B><INPUT type=\"text\" "
+ " id=\"firstname\" value=\"John\"/>"
+ " <B>Last name:</B>"
+ " <INPUT type=\"text\" id=\"lastname\" value=\"Smith\"/>"
+ " <B>Email:</B>"
+ " <INPUT type=\"text\" id=\"email\" value=\"john@example.com\"/>"
+ " <INPUT type=\"submit\" name=\"reply-send\" value=\"Send\"/>"
+ "</FORM>");
+}
+
+TEST_F(FormManagerTest, LabelsInferredPriorToImgOrBr) {
+ ExpectJohnSmithLabels(
+ "<FORM name=\"TestForm\" action=\"http://cnn.com\" method=\"post\">"
+ " First name:<IMG/><INPUT type=\"text\" "
+ " id=\"firstname\" value=\"John\"/>"
+ " Last name:<IMG/>"
+ " <INPUT type=\"text\" id=\"lastname\" value=\"Smith\"/>"
+ " Email:<BR/>"
+ " <INPUT type=\"text\" id=\"email\" value=\"john@example.com\"/>"
+ " <INPUT type=\"submit\" name=\"reply-send\" value=\"Send\"/>"
+ "</FORM>");
+}
+
TEST_F(FormManagerTest, LabelsInferredFromTableCell) {
ExpectJohnSmithLabels(
"<FORM name=\"TestForm\" action=\"http://cnn.com\" method=\"post\">"
« no previous file with comments | « chrome/renderer/autofill/form_manager.cc ('k') | chrome/test/data/autofill/heuristics/output/08_register_bestbuy.com.out » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698