| 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/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "base/values.h" | 6 #include "base/values.h" |
| 7 #include "components/autofill/content/browser/wallet/instrument.h" | 7 #include "components/autofill/content/browser/wallet/instrument.h" |
| 8 #include "components/autofill/content/browser/wallet/wallet_address.h" | 8 #include "components/autofill/content/browser/wallet/wallet_address.h" |
| 9 #include "components/autofill/content/browser/wallet/wallet_test_util.h" | 9 #include "components/autofill/content/browser/wallet/wallet_test_util.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 expected.SetString("type", "CREDIT_CARD"); | 38 expected.SetString("type", "CREDIT_CARD"); |
| 39 expected.SetInteger("credit_card.exp_month", 12); | 39 expected.SetInteger("credit_card.exp_month", 12); |
| 40 expected.SetInteger("credit_card.exp_year", 2015); | 40 expected.SetInteger("credit_card.exp_year", 2015); |
| 41 expected.SetString("credit_card.last_4_digits", kLastFourDigits); | 41 expected.SetString("credit_card.last_4_digits", kLastFourDigits); |
| 42 expected.SetString("credit_card.fop_type", "VISA"); | 42 expected.SetString("credit_card.fop_type", "VISA"); |
| 43 expected.SetString("credit_card.address.country_name_code", "US"); | 43 expected.SetString("credit_card.address.country_name_code", "US"); |
| 44 expected.SetString("credit_card.address.recipient_name", | 44 expected.SetString("credit_card.address.recipient_name", |
| 45 "ship_recipient_name"); | 45 "ship_recipient_name"); |
| 46 expected.SetString("credit_card.address.locality_name", | 46 expected.SetString("credit_card.address.locality_name", |
| 47 "ship_locality_name"); | 47 "ship_locality_name"); |
| 48 expected.SetString("credit_card.address.dependent_locality_name", |
| 49 "ship_dependent_locality_name"); |
| 48 expected.SetString("credit_card.address.administrative_area_name", | 50 expected.SetString("credit_card.address.administrative_area_name", |
| 49 "ship_admin_area_name"); | 51 "ship_admin_area_name"); |
| 50 expected.SetString("credit_card.address.postal_code_number", | 52 expected.SetString("credit_card.address.postal_code_number", |
| 51 "ship_postal_code_number"); | 53 "ship_postal_code_number"); |
| 54 expected.SetString("credit_card.address.sorting_code", |
| 55 "ship_sorting_code"); |
| 52 base::ListValue* address_lines = new base::ListValue(); | 56 base::ListValue* address_lines = new base::ListValue(); |
| 53 address_lines->AppendString("ship_address_line_1"); | 57 address_lines->AppendString("ship_address_line_1"); |
| 54 address_lines->AppendString("ship_address_line_2"); | 58 address_lines->AppendString("ship_address_line_2"); |
| 55 expected.Set("credit_card.address.address_line", address_lines); | 59 expected.Set("credit_card.address.address_line", address_lines); |
| 56 | 60 |
| 57 Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber), | 61 Instrument instrument(ASCIIToUTF16(kPrimaryAccountNumber), |
| 58 ASCIIToUTF16(kCardVerificationNumber), | 62 ASCIIToUTF16(kCardVerificationNumber), |
| 59 12, | 63 12, |
| 60 2015, | 64 2015, |
| 61 Instrument::VISA, | 65 Instrument::VISA, |
| 62 GetTestShippingAddress().Pass()); | 66 GetTestShippingAddress().Pass()); |
| 63 | 67 |
| 64 EXPECT_TRUE(expected.Equals(instrument.ToDictionary().get())); | 68 EXPECT_TRUE(expected.Equals(instrument.ToDictionary().get())); |
| 65 } | 69 } |
| 66 | 70 |
| 67 } // namespace wallet | 71 } // namespace wallet |
| 68 } // namespace autofill | 72 } // namespace autofill |
| OLD | NEW |