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

Side by Side Diff: components/autofill/browser/form_field_unittest.cc

Issue 12434004: Move remaining Autofill code to //components/autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix long lines Created 7 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 | Annotate | Revision Log
« no previous file with comments | « components/autofill/browser/form_field.cc ('k') | components/autofill/browser/form_group.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/scoped_vector.h" 5 #include "base/memory/scoped_vector.h"
6 #include "base/string16.h" 6 #include "base/string16.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/autofill/autofill_field.h" 8 #include "components/autofill/browser/autofill_field.h"
9 #include "chrome/browser/autofill/form_field.h" 9 #include "components/autofill/browser/form_field.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 TEST(FormFieldTest, Match) { 12 TEST(FormFieldTest, Match) {
13 AutofillField field; 13 AutofillField field;
14 14
15 // Empty strings match. 15 // Empty strings match.
16 EXPECT_TRUE(FormField::Match(&field, string16(), FormField::MATCH_LABEL)); 16 EXPECT_TRUE(FormField::Match(&field, string16(), FormField::MATCH_LABEL));
17 17
18 // Empty pattern matches non-empty string. 18 // Empty pattern matches non-empty string.
19 field.label = ASCIIToUTF16("a"); 19 field.label = ASCIIToUTF16("a");
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 FieldTypeMap field_type_map; 137 FieldTypeMap field_type_map;
138 FormField::ParseFormFields(fields.get(), &field_type_map); 138 FormField::ParseFormFields(fields.get(), &field_type_map);
139 // Checkable element shouldn't interfere with inference of Address line2. 139 // Checkable element shouldn't interfere with inference of Address line2.
140 EXPECT_EQ(2U, field_type_map.size()); 140 EXPECT_EQ(2U, field_type_map.size());
141 141
142 EXPECT_EQ(ADDRESS_HOME_LINE1, 142 EXPECT_EQ(ADDRESS_HOME_LINE1,
143 field_type_map.find(ASCIIToUTF16("Address line1"))->second); 143 field_type_map.find(ASCIIToUTF16("Address line1"))->second);
144 EXPECT_EQ(ADDRESS_HOME_LINE2, 144 EXPECT_EQ(ADDRESS_HOME_LINE2,
145 field_type_map.find(ASCIIToUTF16("Address line2"))->second); 145 field_type_map.find(ASCIIToUTF16("Address line2"))->second);
146 } 146 }
OLDNEW
« no previous file with comments | « components/autofill/browser/form_field.cc ('k') | components/autofill/browser/form_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698