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

Side by Side Diff: components/autofill/core/browser/phone_field_unittest.cc

Issue 1031923003: Autofill: Recognize phone numbers in input fields of type number. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autofill_b464002_a
Patch Set: fix bad test expectation 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 | « components/autofill/core/browser/phone_field.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/memory/scoped_vector.h" 6 #include "base/memory/scoped_vector.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "components/autofill/core/browser/autofill_field.h" 8 #include "components/autofill/core/browser/autofill_field.h"
9 #include "components/autofill/core/browser/autofill_scanner.h" 9 #include "components/autofill/core/browser/autofill_scanner.h"
10 #include "components/autofill/core/browser/phone_field.h" 10 #include "components/autofill/core/browser/phone_field.h"
11 #include "components/autofill/core/common/form_field_data.h" 11 #include "components/autofill/core/common/form_field_data.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 using base::ASCIIToUTF16; 14 using base::ASCIIToUTF16;
15 15
16 namespace autofill { 16 namespace autofill {
17 17
18 namespace { 18 namespace {
19 19
20 const char* const kFieldTypes[] = { 20 const char* const kFieldTypes[] = {
21 "text", 21 "text",
22 "tel", 22 "tel",
23 "number",
23 }; 24 };
24 25
25 } // namespace 26 } // namespace
26 27
27 class PhoneFieldTest : public testing::Test { 28 class PhoneFieldTest : public testing::Test {
28 public: 29 public:
29 PhoneFieldTest() {} 30 PhoneFieldTest() {}
30 31
31 protected: 32 protected:
32 // Downcast for tests. 33 // Downcast for tests.
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 AutofillScanner scanner(list_.get()); 242 AutofillScanner scanner(list_.get());
242 field_ = Parse(&scanner); 243 field_ = Parse(&scanner);
243 ASSERT_NE(nullptr, field_.get()); 244 ASSERT_NE(nullptr, field_.get());
244 ASSERT_TRUE(field_->ClassifyField(&field_type_map_)); 245 ASSERT_TRUE(field_->ClassifyField(&field_type_map_));
245 CheckField("country", PHONE_HOME_COUNTRY_CODE); 246 CheckField("country", PHONE_HOME_COUNTRY_CODE);
246 CheckField("phone", PHONE_HOME_CITY_AND_NUMBER); 247 CheckField("phone", PHONE_HOME_CITY_AND_NUMBER);
247 } 248 }
248 } 249 }
249 250
250 } // namespace autofill 251 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/phone_field.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698