| 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 "components/autofill/core/browser/autofill_field.h" | 5 #include "components/autofill/core/browser/autofill_field.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 NotNumericMonthsContentsWithPlaceholder()}, | 555 NotNumericMonthsContentsWithPlaceholder()}, |
| 556 // Values start at 01 and the first content is a placeholder. | 556 // Values start at 01 and the first content is a placeholder. |
| 557 {{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", | 557 {{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", |
| 558 "13"}, | 558 "13"}, |
| 559 NotNumericMonthsContentsWithPlaceholder()}, | 559 NotNumericMonthsContentsWithPlaceholder()}, |
| 560 // Values start at 0 after a placeholder. | 560 // Values start at 0 after a placeholder. |
| 561 {{"?", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, | 561 {{"?", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, |
| 562 NotNumericMonthsContentsWithPlaceholder()}, | 562 NotNumericMonthsContentsWithPlaceholder()}, |
| 563 // Values start at 1 after a placeholder. | 563 // Values start at 1 after a placeholder. |
| 564 {{"?", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, | 564 {{"?", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, |
| 565 NotNumericMonthsContentsWithPlaceholder()}, |
| 566 // Values start at 0 after a negative number. |
| 567 {{"-1", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, |
| 568 NotNumericMonthsContentsWithPlaceholder()}, |
| 569 // Values start at 1 after a negative number. |
| 570 {{"-1", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, |
| 565 NotNumericMonthsContentsWithPlaceholder()}}; | 571 NotNumericMonthsContentsWithPlaceholder()}}; |
| 566 | 572 |
| 567 for (TestCase test_case : test_cases) { | 573 for (TestCase test_case : test_cases) { |
| 568 ASSERT_EQ(test_case.select_values.size(), test_case.select_contents.size()); | 574 ASSERT_EQ(test_case.select_values.size(), test_case.select_contents.size()); |
| 569 | 575 |
| 570 TestFillingExpirationMonth(test_case.select_values, | 576 TestFillingExpirationMonth(test_case.select_values, |
| 571 test_case.select_contents, | 577 test_case.select_contents, |
| 572 test_case.select_values.size()); | 578 test_case.select_values.size()); |
| 573 } | 579 } |
| 574 } | 580 } |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 EXPECT_EQ(-1, ret); | 879 EXPECT_EQ(-1, ret); |
| 874 | 880 |
| 875 // Case 7: No match (not present) | 881 // Case 7: No match (not present) |
| 876 ret = AutofillField::FindShortestSubstringMatchInSelect( | 882 ret = AutofillField::FindShortestSubstringMatchInSelect( |
| 877 ASCIIToUTF16("Canadia"), true, &field); | 883 ASCIIToUTF16("Canadia"), true, &field); |
| 878 EXPECT_EQ(-1, ret); | 884 EXPECT_EQ(-1, ret); |
| 879 } | 885 } |
| 880 | 886 |
| 881 } // namespace | 887 } // namespace |
| 882 } // namespace autofill | 888 } // namespace autofill |
| OLD | NEW |