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

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: fix code 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
« no previous file with comments | « components/autofill/core/browser/autofill_field.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 NotNumericMonthsContentsNoPlaceholder()}, 510 NotNumericMonthsContentsNoPlaceholder()},
511 // Values start at 1 but single digits are whitespace padded! 511 // Values start at 1 but single digits are whitespace padded!
512 {{" 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", "10", "11", "12"}, 512 {{" 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8", " 9", "10", "11", "12"},
513 NotNumericMonthsContentsNoPlaceholder()}, 513 NotNumericMonthsContentsNoPlaceholder()},
514 // Values start at 0. 514 // Values start at 0.
515 {{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, 515 {{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"},
516 NotNumericMonthsContentsNoPlaceholder()}, 516 NotNumericMonthsContentsNoPlaceholder()},
517 // Values start at 00. 517 // Values start at 00.
518 {{"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11"}, 518 {{"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11"},
519 NotNumericMonthsContentsNoPlaceholder()}, 519 NotNumericMonthsContentsNoPlaceholder()},
520 // The AngularJS framework adds a prefix to number types. Test that it is
521 // removed.
522 {{"number:1", "number:2", "number:3", "number:4", "number:5", "number:6",
523 "number:7", "number:8", "number:9", "number:10", "number:11",
524 "number:12"},
525 NotNumericMonthsContentsNoPlaceholder()},
520 // Values start at 0 and the first content is a placeholder. 526 // Values start at 0 and the first content is a placeholder.
521 {{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, 527 {{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
522 NotNumericMonthsContentsWithPlaceholder()}, 528 NotNumericMonthsContentsWithPlaceholder()},
523 // Values start at 1 and the first content is a placeholder. 529 // Values start at 1 and the first content is a placeholder.
524 {{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"}, 530 {{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"},
525 NotNumericMonthsContentsWithPlaceholder()}, 531 NotNumericMonthsContentsWithPlaceholder()},
526 // Values start at 01 and the first content is a placeholder. 532 // Values start at 01 and the first content is a placeholder.
527 {{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", 533 {{"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12",
528 "13"}, 534 "13"},
529 NotNumericMonthsContentsWithPlaceholder()}, 535 NotNumericMonthsContentsWithPlaceholder()},
(...skipping 361 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
« no previous file with comments | « components/autofill/core/browser/autofill_field.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698