| 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "chrome/browser/autofill/autofill_field.h" |
| 6 #include "chrome/browser/autofill/form_field.h" | 7 #include "chrome/browser/autofill/form_field.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 9 |
| 9 namespace { | 10 namespace { |
| 10 | 11 |
| 11 TEST(FormFieldTest, Match) { | 12 TEST(FormFieldTest, Match) { |
| 12 AutofillField field; | 13 AutofillField field; |
| 13 | 14 |
| 14 // Empty strings match. | 15 // Empty strings match. |
| 15 EXPECT_TRUE(FormField::Match(&field, string16(), true)); | 16 EXPECT_TRUE(FormField::Match(&field, string16(), true)); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head|other"), true)); | 75 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head|other"), true)); |
| 75 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("tail|other"), true)); | 76 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("tail|other"), true)); |
| 76 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("bad|good"), true)); | 77 EXPECT_FALSE(FormField::Match(&field, ASCIIToUTF16("bad|good"), true)); |
| 77 | 78 |
| 78 // Case sensitivity. | 79 // Case sensitivity. |
| 79 field.label = ASCIIToUTF16("xxxHeAd_tAiLxxx"); | 80 field.label = ASCIIToUTF16("xxxHeAd_tAiLxxx"); |
| 80 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head_tail"), true)); | 81 EXPECT_TRUE(FormField::Match(&field, ASCIIToUTF16("head_tail"), true)); |
| 81 } | 82 } |
| 82 | 83 |
| 83 } // namespace | 84 } // namespace |
| OLD | NEW |