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_regexes.h" | 5 #include "components/autofill/core/browser/autofill_regexes.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "components/autofill/core/browser/autofill_regex_constants.h" | 9 #include "components/autofill/core/browser/autofill_regex_constants.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 | 11 |
| 12 using base::ASCIIToUTF16; |
| 13 |
12 namespace autofill { | 14 namespace autofill { |
13 | 15 |
14 TEST(AutofillRegexesTest, AutofillRegexes) { | 16 TEST(AutofillRegexesTest, AutofillRegexes) { |
15 struct TestCase { | 17 struct TestCase { |
16 const char* const input; | 18 const char* const input; |
17 const char* const pattern; | 19 const char* const pattern; |
18 }; | 20 }; |
19 | 21 |
20 const TestCase kPositiveCases[] = { | 22 const TestCase kPositiveCases[] = { |
21 // Empty pattern | 23 // Empty pattern |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kNegativeCases); ++i) { | 57 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kNegativeCases); ++i) { |
56 const TestCase& test_case = kNegativeCases[i]; | 58 const TestCase& test_case = kNegativeCases[i]; |
57 SCOPED_TRACE(test_case.input); | 59 SCOPED_TRACE(test_case.input); |
58 SCOPED_TRACE(test_case.pattern); | 60 SCOPED_TRACE(test_case.pattern); |
59 EXPECT_FALSE(autofill::MatchesPattern(ASCIIToUTF16(test_case.input), | 61 EXPECT_FALSE(autofill::MatchesPattern(ASCIIToUTF16(test_case.input), |
60 ASCIIToUTF16(test_case.pattern))); | 62 ASCIIToUTF16(test_case.pattern))); |
61 } | 63 } |
62 } | 64 } |
63 | 65 |
64 } // namespace autofill | 66 } // namespace autofill |
OLD | NEW |