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

Side by Side Diff: chrome/renderer/autofill/form_autofill_browsertest.cc

Issue 1018553002: Autofill: Fix broken DCHECK from r320637. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/autofill/content/renderer/form_autofill_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <vector> 5 #include <vector>
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 3108 matching lines...) Expand 10 before | Expand all | Expand 10 after
3119 values.push_back(ASCIIToUTF16("123")); 3119 values.push_back(ASCIIToUTF16("123"));
3120 3120
3121 labels.push_back(ASCIIToUTF16("Phone")); 3121 labels.push_back(ASCIIToUTF16("Phone"));
3122 names.push_back(ASCIIToUTF16("phone2")); 3122 names.push_back(ASCIIToUTF16("phone2"));
3123 values.push_back(ASCIIToUTF16("456")); 3123 values.push_back(ASCIIToUTF16("456"));
3124 3124
3125 labels.push_back(ASCIIToUTF16("Phone")); 3125 labels.push_back(ASCIIToUTF16("Phone"));
3126 names.push_back(ASCIIToUTF16("phone3")); 3126 names.push_back(ASCIIToUTF16("phone3"));
3127 values.push_back(ASCIIToUTF16("7890")); 3127 values.push_back(ASCIIToUTF16("7890"));
3128 3128
3129 labels.push_back(ASCIIToUTF16("Credit Card Number"));
3130 names.push_back(ASCIIToUTF16("ccnumber"));
3131 values.push_back(ASCIIToUTF16("4444555544445555"));
3132
3129 ExpectLabels( 3133 ExpectLabels(
3130 "<FORM name='TestForm' action='http://cnn.com' method='post'>" 3134 "<FORM name='TestForm' action='http://cnn.com' method='post'>"
3131 "<TABLE>" 3135 "<TABLE>"
3132 " <TR>" 3136 " <TR>"
3133 " <TD>*First Name</TD>" 3137 " <TD>*First Name</TD>"
3134 " <TD>*Last Name</TD>" 3138 " <TD>*Last Name</TD>"
3135 " <TD>*Email</TD>" 3139 " <TD>*Email</TD>"
3136 " </TR>" 3140 " </TR>"
3137 " <TR>" 3141 " <TR>"
3138 " <TD>" 3142 " <TD>"
(...skipping 26 matching lines...) Expand all
3165 " <INPUT type='text' id='phone1' value='123'/>" 3169 " <INPUT type='text' id='phone1' value='123'/>"
3166 " </TD>" 3170 " </TD>"
3167 " <TD>" 3171 " <TD>"
3168 " <INPUT type='text' id='phone2' value='456'/>" 3172 " <INPUT type='text' id='phone2' value='456'/>"
3169 " </TD>" 3173 " </TD>"
3170 " <TD>" 3174 " <TD>"
3171 " <INPUT type='text' id='phone3' value='7890'/>" 3175 " <INPUT type='text' id='phone3' value='7890'/>"
3172 " </TD>" 3176 " </TD>"
3173 " </TR>" 3177 " </TR>"
3174 " <TR>" 3178 " <TR>"
3179 " <TH>"
3180 " Credit Card Number"
3181 " </TH>"
3182 " </TR>"
3183 " <TR>"
3184 " <TD>"
3185 " <INPUT type='text' name='ccnumber' value='4444555544445555'/>"
3186 " </TD>"
3187 " </TR>"
3188 " <TR>"
3175 " <TD>" 3189 " <TD>"
3176 " <INPUT type='submit' name='reply-send' value='Send'/>" 3190 " <INPUT type='submit' name='reply-send' value='Send'/>"
3177 " </TD>" 3191 " </TD>"
3178 " </TR>" 3192 " </TR>"
3179 "</TABLE>", 3193 "</TABLE>",
3180 labels, names, values); 3194 labels, names, values);
3181 } 3195 }
3182 3196
3183 // Verify that we correctly infer labels when enclosed within a list item. 3197 // Verify that we correctly infer labels when enclosed within a list item.
3184 TEST_F(FormAutofillTest, LabelsInferredFromListItem) { 3198 TEST_F(FormAutofillTest, LabelsInferredFromListItem) {
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
4132 ASSERT_TRUE(control_elements.empty()); 4146 ASSERT_TRUE(control_elements.empty());
4133 ASSERT_TRUE(fieldsets.empty()); 4147 ASSERT_TRUE(fieldsets.empty());
4134 4148
4135 FormData form; 4149 FormData form;
4136 EXPECT_FALSE(UnownedFormElementsAndFieldSetsToFormData( 4150 EXPECT_FALSE(UnownedFormElementsAndFieldSetsToFormData(
4137 fieldsets, control_elements, nullptr, dummy_origin, REQUIRE_NONE, 4151 fieldsets, control_elements, nullptr, dummy_origin, REQUIRE_NONE,
4138 extract_mask, &form, nullptr)); 4152 extract_mask, &form, nullptr));
4139 } 4153 }
4140 4154
4141 } // namespace autofill 4155 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/content/renderer/form_autofill_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698