| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/autofill/autofill_profile.h" | 7 #include "chrome/browser/autofill/autofill_profile.h" |
| 8 #include "chrome/browser/autofill/autofill_type.h" | 8 #include "chrome/browser/autofill/autofill_type.h" |
| 9 #include "chrome/browser/autofill/credit_card.h" | 9 #include "chrome/browser/autofill/credit_card.h" |
| 10 #include "chrome/browser/autofill/select_control_handler.h" | 10 #include "chrome/browser/autofill/select_control_handler.h" |
| 11 #include "chrome/test/testing_browser_process_test.h" | 11 #include "chrome/test/base/testing_browser_process_test.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "webkit/glue/form_field.h" | 13 #include "webkit/glue/form_field.h" |
| 14 | 14 |
| 15 typedef TestingBrowserProcessTest SelectControlHandlerTest; | 15 typedef TestingBrowserProcessTest SelectControlHandlerTest; |
| 16 | 16 |
| 17 TEST_F(SelectControlHandlerTest, CreditCardMonthExact) { | 17 TEST_F(SelectControlHandlerTest, CreditCardMonthExact) { |
| 18 const char* const kMonthsNumeric[] = { | 18 const char* const kMonthsNumeric[] = { |
| 19 "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", | 19 "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", |
| 20 }; | 20 }; |
| 21 std::vector<string16> options(arraysize(kMonthsNumeric)); | 21 std::vector<string16> options(arraysize(kMonthsNumeric)); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 webkit_glue::FormField field; | 204 webkit_glue::FormField field; |
| 205 field.form_control_type = ASCIIToUTF16("select-one"); | 205 field.form_control_type = ASCIIToUTF16("select-one"); |
| 206 field.option_values = values; | 206 field.option_values = values; |
| 207 field.option_contents = contents; | 207 field.option_contents = contents; |
| 208 | 208 |
| 209 AutofillProfile profile; | 209 AutofillProfile profile; |
| 210 profile.SetInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("California")); | 210 profile.SetInfo(ADDRESS_HOME_STATE, ASCIIToUTF16("California")); |
| 211 autofill::FillSelectControl(profile, ADDRESS_HOME_STATE, &field); | 211 autofill::FillSelectControl(profile, ADDRESS_HOME_STATE, &field); |
| 212 EXPECT_EQ(ASCIIToUTF16("2"), field.value); | 212 EXPECT_EQ(ASCIIToUTF16("2"), field.value); |
| 213 } | 213 } |
| OLD | NEW |