| 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/name_field.h" | 10 #include "components/autofill/core/browser/name_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; |
| 15 |
| 14 namespace autofill { | 16 namespace autofill { |
| 15 | 17 |
| 16 class NameFieldTest : public testing::Test { | 18 class NameFieldTest : public testing::Test { |
| 17 public: | 19 public: |
| 18 NameFieldTest() {} | 20 NameFieldTest() {} |
| 19 | 21 |
| 20 protected: | 22 protected: |
| 21 ScopedVector<const AutofillField> list_; | 23 ScopedVector<const AutofillField> list_; |
| 22 scoped_ptr<NameField> field_; | 24 scoped_ptr<NameField> field_; |
| 23 ServerFieldTypeMap field_type_map_; | 25 ServerFieldTypeMap field_type_map_; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 EXPECT_EQ(NAME_FIRST, field_type_map_[ASCIIToUTF16("name1")]); | 304 EXPECT_EQ(NAME_FIRST, field_type_map_[ASCIIToUTF16("name1")]); |
| 303 ASSERT_TRUE( | 305 ASSERT_TRUE( |
| 304 field_type_map_.find(ASCIIToUTF16("name2")) != field_type_map_.end()); | 306 field_type_map_.find(ASCIIToUTF16("name2")) != field_type_map_.end()); |
| 305 EXPECT_EQ(NAME_MIDDLE_INITIAL, field_type_map_[ASCIIToUTF16("name2")]); | 307 EXPECT_EQ(NAME_MIDDLE_INITIAL, field_type_map_[ASCIIToUTF16("name2")]); |
| 306 ASSERT_TRUE( | 308 ASSERT_TRUE( |
| 307 field_type_map_.find(ASCIIToUTF16("name3")) != field_type_map_.end()); | 309 field_type_map_.find(ASCIIToUTF16("name3")) != field_type_map_.end()); |
| 308 EXPECT_EQ(NAME_LAST, field_type_map_[ASCIIToUTF16("name3")]); | 310 EXPECT_EQ(NAME_LAST, field_type_map_[ASCIIToUTF16("name3")]); |
| 309 } | 311 } |
| 310 | 312 |
| 311 } // namespace autofill | 313 } // namespace autofill |
| OLD | NEW |