| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/scoped_ptr.h" | 5 #include "base/scoped_ptr.h" |
| 6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/autofill/form_structure.h" | 8 #include "chrome/browser/autofill/form_structure.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 ASCIIToUTF16("dayphone1"), | 1106 ASCIIToUTF16("dayphone1"), |
| 1107 string16(), | 1107 string16(), |
| 1108 ASCIIToUTF16("text"), | 1108 ASCIIToUTF16("text"), |
| 1109 0, | 1109 0, |
| 1110 false)); | 1110 false)); |
| 1111 form.fields.push_back( | 1111 form.fields.push_back( |
| 1112 webkit_glue::FormField(ASCIIToUTF16("-"), | 1112 webkit_glue::FormField(ASCIIToUTF16("-"), |
| 1113 ASCIIToUTF16("dayphone2"), | 1113 ASCIIToUTF16("dayphone2"), |
| 1114 string16(), | 1114 string16(), |
| 1115 ASCIIToUTF16("text"), | 1115 ASCIIToUTF16("text"), |
| 1116 0, | 1116 3, // Size of prefix is 3. |
| 1117 false)); | 1117 false)); |
| 1118 form.fields.push_back( | 1118 form.fields.push_back( |
| 1119 webkit_glue::FormField(ASCIIToUTF16("-"), | 1119 webkit_glue::FormField(ASCIIToUTF16("-"), |
| 1120 ASCIIToUTF16("dayphone3"), | 1120 ASCIIToUTF16("dayphone3"), |
| 1121 string16(), | 1121 string16(), |
| 1122 ASCIIToUTF16("text"), | 1122 ASCIIToUTF16("text"), |
| 1123 0, | 1123 4, // Size of suffix is 4. If unlimited size is |
| 1124 // passed, phone will be parsed as |
| 1125 // <country code> - <area code> - <phone>. |
| 1124 false)); | 1126 false)); |
| 1125 form.fields.push_back( | 1127 form.fields.push_back( |
| 1126 webkit_glue::FormField(ASCIIToUTF16("ext.:"), | 1128 webkit_glue::FormField(ASCIIToUTF16("ext.:"), |
| 1127 ASCIIToUTF16("dayphone4"), | 1129 ASCIIToUTF16("dayphone4"), |
| 1128 string16(), | 1130 string16(), |
| 1129 ASCIIToUTF16("text"), | 1131 ASCIIToUTF16("text"), |
| 1130 0, | 1132 0, |
| 1131 false)); | 1133 false)); |
| 1132 form_structure.reset(new FormStructure(form)); | 1134 form_structure.reset(new FormStructure(form)); |
| 1133 EXPECT_TRUE(form_structure->IsAutoFillable(true)); | 1135 EXPECT_TRUE(form_structure->IsAutoFillable(true)); |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1771 form_structure->FormSignature()); | 1773 form_structure->FormSignature()); |
| 1772 | 1774 |
| 1773 form.name = ASCIIToUTF16("login_form"); | 1775 form.name = ASCIIToUTF16("login_form"); |
| 1774 form_structure.reset(new FormStructure(form)); | 1776 form_structure.reset(new FormStructure(form)); |
| 1775 EXPECT_EQ(FormStructureTest::Hash64Bit( | 1777 EXPECT_EQ(FormStructureTest::Hash64Bit( |
| 1776 std::string("https://login.facebook.com&login_form&email&first")), | 1778 std::string("https://login.facebook.com&login_form&email&first")), |
| 1777 form_structure->FormSignature()); | 1779 form_structure->FormSignature()); |
| 1778 } | 1780 } |
| 1779 | 1781 |
| 1780 } // namespace | 1782 } // namespace |
| OLD | NEW |