| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/autofill/core/browser/address_i18n.h" | 5 #include "components/autofill/core/browser/address_i18n.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> |
| 9 #include <string> | 10 #include <string> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/guid.h" | 13 #include "base/guid.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "components/autofill/core/browser/autofill_profile.h" | 15 #include "components/autofill/core/browser/autofill_profile.h" |
| 16 #include "components/autofill/core/browser/autofill_test_utils.h" | 16 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 17 #include "components/autofill/core/browser/field_types.h" | 17 #include "components/autofill/core/browser/field_types.h" |
| 18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_da
ta.h" | 19 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_da
ta.h" |
| 20 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fi
eld.h" | 20 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fi
eld.h" |
| 21 | 21 |
| 22 namespace autofill { | 22 namespace autofill { |
| 23 namespace i18n { | 23 namespace i18n { |
| 24 | 24 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 "Doe", | 103 "Doe", |
| 104 "johndoe@hades.com", | 104 "johndoe@hades.com", |
| 105 "Underworld", | 105 "Underworld", |
| 106 "666 Erebus St.", | 106 "666 Erebus St.", |
| 107 "Apt 8", | 107 "Apt 8", |
| 108 "Elysium", "CA", | 108 "Elysium", "CA", |
| 109 "91111", | 109 "91111", |
| 110 "US", | 110 "US", |
| 111 "16502111111"); | 111 "16502111111"); |
| 112 profile.set_language_code("en"); | 112 profile.set_language_code("en"); |
| 113 scoped_ptr<AddressData> actual = | 113 std::unique_ptr<AddressData> actual = |
| 114 CreateAddressDataFromAutofillProfile(profile, "en_US"); | 114 CreateAddressDataFromAutofillProfile(profile, "en_US"); |
| 115 | 115 |
| 116 AddressData expected; | 116 AddressData expected; |
| 117 expected.region_code = "US"; | 117 expected.region_code = "US"; |
| 118 expected.address_line.push_back("666 Erebus St."); | 118 expected.address_line.push_back("666 Erebus St."); |
| 119 expected.address_line.push_back("Apt 8"); | 119 expected.address_line.push_back("Apt 8"); |
| 120 expected.administrative_area = "CA"; | 120 expected.administrative_area = "CA"; |
| 121 expected.locality = "Elysium"; | 121 expected.locality = "Elysium"; |
| 122 expected.postal_code = "91111"; | 122 expected.postal_code = "91111"; |
| 123 expected.language_code = "en"; | 123 expected.language_code = "en"; |
| 124 expected.organization = "Underworld"; | 124 expected.organization = "Underworld"; |
| 125 expected.recipient = "John H. Doe"; | 125 expected.recipient = "John H. Doe"; |
| 126 | 126 |
| 127 EXPECT_EQ(expected, *actual); | 127 EXPECT_EQ(expected, *actual); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace i18n | 130 } // namespace i18n |
| 131 } // namespace autofill | 131 } // namespace autofill |
| OLD | NEW |