| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "components/autofill/core/browser/address.h" | 9 #include "components/autofill/core/browser/address.h" |
| 10 #include "components/autofill/core/browser/autofill_type.h" | 10 #include "components/autofill/core/browser/autofill_type.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 using base::ASCIIToUTF16; |
| 14 |
| 13 namespace autofill { | 15 namespace autofill { |
| 14 | 16 |
| 15 // Test that country data can be properly returned as either a country code or a | 17 // Test that country data can be properly returned as either a country code or a |
| 16 // localized country name. | 18 // localized country name. |
| 17 TEST(AddressTest, GetCountry) { | 19 TEST(AddressTest, GetCountry) { |
| 18 Address address; | 20 Address address; |
| 19 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_COUNTRY)); | 21 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_COUNTRY)); |
| 20 | 22 |
| 21 // Make sure that nothing breaks when the country code is missing. | 23 // Make sure that nothing breaks when the country code is missing. |
| 22 base::string16 country = | 24 base::string16 country = |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 ASCIIToUTF16("Address line 1" | 343 ASCIIToUTF16("Address line 1" |
| 342 "Address line 2" | 344 "Address line 2" |
| 343 "\n"), | 345 "\n"), |
| 344 "en-US")); | 346 "en-US")); |
| 345 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_LINE1)); | 347 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_LINE1)); |
| 346 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_LINE2)); | 348 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_LINE2)); |
| 347 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS)); | 349 EXPECT_EQ(base::string16(), address.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS)); |
| 348 } | 350 } |
| 349 | 351 |
| 350 } // namespace autofill | 352 } // namespace autofill |
| OLD | NEW |