Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: components/autofill/core/browser/autofill_field_unittest.cc

Issue 1905143002: Autofill: Check for common angular js prefix when filling exp month. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 {{"?", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, 531 {{"?", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"},
532 NotNumericMonthsContentsWithPlaceholder()}, 532 NotNumericMonthsContentsWithPlaceholder()},
533 // Values start at 1 after a placeholder. 533 // Values start at 1 after a placeholder.
534 {{"?", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, 534 {{"?", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
535 NotNumericMonthsContentsWithPlaceholder()}, 535 NotNumericMonthsContentsWithPlaceholder()},
536 // Values start at 0 after a negative number. 536 // Values start at 0 after a negative number.
537 {{"-1", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, 537 {{"-1", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"},
538 NotNumericMonthsContentsWithPlaceholder()}, 538 NotNumericMonthsContentsWithPlaceholder()},
539 // Values start at 1 after a negative number. 539 // Values start at 1 after a negative number.
540 {{"-1", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, 540 {{"-1", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
541 NotNumericMonthsContentsWithPlaceholder()},
542 // The AngularJS framework adds a prefix to number types. Test that it is
543 // removed.
544 {{"number:1", "number:2", "number:3", "number:4", "number:5", "number:6",
545 "number:7", "number:8", "number:9", "number:10", "number:11",
546 "number:12"},
541 NotNumericMonthsContentsWithPlaceholder()}}; 547 NotNumericMonthsContentsWithPlaceholder()}};
542 548
543 for (TestCase test_case : test_cases) { 549 for (TestCase test_case : test_cases) {
544 ASSERT_EQ(test_case.select_values.size(), test_case.select_contents.size()); 550 ASSERT_EQ(test_case.select_values.size(), test_case.select_contents.size());
545 551
546 TestFillingExpirationMonth(test_case.select_values, 552 TestFillingExpirationMonth(test_case.select_values,
547 test_case.select_contents, 553 test_case.select_contents,
548 test_case.select_values.size()); 554 test_case.select_values.size());
549 } 555 }
550 } 556 }
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 bool has_filled = AutofillField::FillFormField( 897 bool has_filled = AutofillField::FillFormField(
892 field, ASCIIToUTF16(test_case.value_to_fill), "en-US", "en-US", &field); 898 field, ASCIIToUTF16(test_case.value_to_fill), "en-US", "en-US", &field);
893 899
894 EXPECT_EQ(test_case.should_fill, has_filled); 900 EXPECT_EQ(test_case.should_fill, has_filled);
895 EXPECT_EQ(ASCIIToUTF16(test_case.expected_value), field.value); 901 EXPECT_EQ(ASCIIToUTF16(test_case.expected_value), field.value);
896 } 902 }
897 } 903 }
898 904
899 } // namespace 905 } // namespace
900 } // namespace autofill 906 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698