| 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/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" | 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" |
| 9 #include "chrome/browser/ui/autofill/data_model_wrapper.h" | 9 #include "chrome/browser/ui/autofill/data_model_wrapper.h" |
| 10 #include "components/autofill/content/browser/wallet/wallet_items.h" | 10 #include "components/autofill/content/browser/wallet/wallet_items.h" |
| 11 #include "components/autofill/content/browser/wallet/wallet_test_util.h" | 11 #include "components/autofill/content/browser/wallet/wallet_test_util.h" |
| 12 #include "components/autofill/core/browser/autofill_profile.h" | 12 #include "components/autofill/core/browser/autofill_profile.h" |
| 13 #include "components/autofill/core/browser/autofill_test_utils.h" | 13 #include "components/autofill/core/browser/autofill_test_utils.h" |
| 14 #include "components/autofill/core/browser/credit_card.h" | 14 #include "components/autofill/core/browser/credit_card.h" |
| 15 #include "components/autofill/core/browser/field_types.h" | 15 #include "components/autofill/core/browser/field_types.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 using base::ASCIIToUTF16; |
| 19 |
| 18 namespace autofill { | 20 namespace autofill { |
| 19 | 21 |
| 20 TEST(AutofillCreditCardWrapperTest, GetInfoCreditCardExpMonth) { | 22 TEST(AutofillCreditCardWrapperTest, GetInfoCreditCardExpMonth) { |
| 21 CreditCard card; | 23 CreditCard card; |
| 22 MonthComboboxModel model; | 24 MonthComboboxModel model; |
| 23 for (int month = 1; month <= 12; ++month) { | 25 for (int month = 1; month <= 12; ++month) { |
| 24 card.SetRawInfo(CREDIT_CARD_EXP_MONTH, base::IntToString16(month)); | 26 card.SetRawInfo(CREDIT_CARD_EXP_MONTH, base::IntToString16(month)); |
| 25 AutofillCreditCardWrapper wrapper(&card); | 27 AutofillCreditCardWrapper wrapper(&card); |
| 26 EXPECT_EQ(model.GetItemAt(month), | 28 EXPECT_EQ(model.GetItemAt(month), |
| 27 wrapper.GetInfo(AutofillType(CREDIT_CARD_EXP_MONTH))); | 29 wrapper.GetInfo(AutofillType(CREDIT_CARD_EXP_MONTH))); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 outputs[inputs[0].type] = ASCIIToUTF16("123 billing street"); | 185 outputs[inputs[0].type] = ASCIIToUTF16("123 billing street"); |
| 184 outputs[inputs[1].type] = ASCIIToUTF16("123 shipping street"); | 186 outputs[inputs[1].type] = ASCIIToUTF16("123 shipping street"); |
| 185 | 187 |
| 186 FieldMapWrapper wrapper(outputs); | 188 FieldMapWrapper wrapper(outputs); |
| 187 wrapper.FillInputs(&inputs); | 189 wrapper.FillInputs(&inputs); |
| 188 | 190 |
| 189 EXPECT_NE(inputs[0].initial_value, inputs[1].initial_value); | 191 EXPECT_NE(inputs[0].initial_value, inputs[1].initial_value); |
| 190 } | 192 } |
| 191 | 193 |
| 192 } // namespace autofill | 194 } // namespace autofill |
| OLD | NEW |