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 |
1124 // passed phone will be parsed as CC-AC-PHONE. | |
dhollowa
2011/02/16 00:25:37
Suggestion: ...phone will be parsed as <country co
GeorgeY
2011/02/16 20:53:34
Done.
| |
1124 false)); | 1125 false)); |
1125 form.fields.push_back( | 1126 form.fields.push_back( |
1126 webkit_glue::FormField(ASCIIToUTF16("ext.:"), | 1127 webkit_glue::FormField(ASCIIToUTF16("ext.:"), |
1127 ASCIIToUTF16("dayphone4"), | 1128 ASCIIToUTF16("dayphone4"), |
1128 string16(), | 1129 string16(), |
1129 ASCIIToUTF16("text"), | 1130 ASCIIToUTF16("text"), |
1130 0, | 1131 0, |
1131 false)); | 1132 false)); |
1132 form_structure.reset(new FormStructure(form)); | 1133 form_structure.reset(new FormStructure(form)); |
1133 EXPECT_TRUE(form_structure->IsAutoFillable(true)); | 1134 EXPECT_TRUE(form_structure->IsAutoFillable(true)); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1771 form_structure->FormSignature()); | 1772 form_structure->FormSignature()); |
1772 | 1773 |
1773 form.name = ASCIIToUTF16("login_form"); | 1774 form.name = ASCIIToUTF16("login_form"); |
1774 form_structure.reset(new FormStructure(form)); | 1775 form_structure.reset(new FormStructure(form)); |
1775 EXPECT_EQ(FormStructureTest::Hash64Bit( | 1776 EXPECT_EQ(FormStructureTest::Hash64Bit( |
1776 std::string("https://login.facebook.com&login_form&email&first")), | 1777 std::string("https://login.facebook.com&login_form&email&first")), |
1777 form_structure->FormSignature()); | 1778 form_structure->FormSignature()); |
1778 } | 1779 } |
1779 | 1780 |
1780 } // namespace | 1781 } // namespace |
OLD | NEW |