| 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/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "components/autofill/content/browser/wallet/wallet_address.h" | 10 #include "components/autofill/content/browser/wallet/wallet_address.h" |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 Address address1("FR", | 441 Address address1("FR", |
| 442 ASCIIToUTF16("recipient_name"), | 442 ASCIIToUTF16("recipient_name"), |
| 443 ASCIIToUTF16("address_line_1"), | 443 ASCIIToUTF16("address_line_1"), |
| 444 ASCIIToUTF16("address_line_2"), | 444 ASCIIToUTF16("address_line_2"), |
| 445 ASCIIToUTF16("locality_name"), | 445 ASCIIToUTF16("locality_name"), |
| 446 ASCIIToUTF16("administrative_area_name"), | 446 ASCIIToUTF16("administrative_area_name"), |
| 447 ASCIIToUTF16("postal_code_number"), | 447 ASCIIToUTF16("postal_code_number"), |
| 448 ASCIIToUTF16("phone_number"), | 448 ASCIIToUTF16("phone_number"), |
| 449 "id1"); | 449 "id1"); |
| 450 AutofillType type = AutofillType(HTML_TYPE_STREET_ADDRESS, HTML_MODE_NONE); | 450 AutofillType type = AutofillType(HTML_TYPE_STREET_ADDRESS, HTML_MODE_NONE); |
| 451 EXPECT_EQ(ASCIIToUTF16("address_line_1, address_line_2"), | 451 EXPECT_EQ(ASCIIToUTF16("address_line_1\naddress_line_2"), |
| 452 address1.GetInfo(type, "en-US")); | 452 address1.GetInfo(type, "en-US")); |
| 453 | 453 |
| 454 // Address has only line 1. | 454 // Address has only line 1. |
| 455 Address address2("FR", | 455 Address address2("FR", |
| 456 ASCIIToUTF16("recipient_name"), | 456 ASCIIToUTF16("recipient_name"), |
| 457 ASCIIToUTF16("address_line_1"), | 457 ASCIIToUTF16("address_line_1"), |
| 458 base::string16(), | 458 base::string16(), |
| 459 ASCIIToUTF16("locality_name"), | 459 ASCIIToUTF16("locality_name"), |
| 460 ASCIIToUTF16("administrative_area_name"), | 460 ASCIIToUTF16("administrative_area_name"), |
| 461 ASCIIToUTF16("postal_code_number"), | 461 ASCIIToUTF16("postal_code_number"), |
| 462 ASCIIToUTF16("phone_number"), | 462 ASCIIToUTF16("phone_number"), |
| 463 "id1"); | 463 "id1"); |
| 464 EXPECT_EQ(ASCIIToUTF16("address_line_1"), address2.GetInfo(type, "en-US")); | 464 EXPECT_EQ(ASCIIToUTF16("address_line_1"), address2.GetInfo(type, "en-US")); |
| 465 | 465 |
| 466 // Address has no address lines. | 466 // Address has no address lines. |
| 467 Address address3("FR", | 467 Address address3("FR", |
| 468 ASCIIToUTF16("recipient_name"), | 468 ASCIIToUTF16("recipient_name"), |
| 469 base::string16(), | 469 base::string16(), |
| 470 base::string16(), | 470 base::string16(), |
| 471 ASCIIToUTF16("locality_name"), | 471 ASCIIToUTF16("locality_name"), |
| 472 ASCIIToUTF16("administrative_area_name"), | 472 ASCIIToUTF16("administrative_area_name"), |
| 473 ASCIIToUTF16("postal_code_number"), | 473 ASCIIToUTF16("postal_code_number"), |
| 474 ASCIIToUTF16("phone_number"), | 474 ASCIIToUTF16("phone_number"), |
| 475 "id1"); | 475 "id1"); |
| 476 EXPECT_EQ(base::string16(), address3.GetInfo(type, "en-US")); | 476 EXPECT_EQ(base::string16(), address3.GetInfo(type, "en-US")); |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace wallet | 479 } // namespace wallet |
| 480 } // namespace autofill | 480 } // namespace autofill |
| OLD | NEW |