OLD | NEW |
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 Loading... |
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 |
OLD | NEW |