| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 builder.AddTextField("username", "johnsmith", nullptr); | 1463 builder.AddTextField("username", "johnsmith", nullptr); |
| 1464 builder.AddPasswordField("password", "secret", nullptr); | 1464 builder.AddPasswordField("password", "secret", nullptr); |
| 1465 std::string html = builder.ProduceHTML(); | 1465 std::string html = builder.ProduceHTML(); |
| 1466 | 1466 |
| 1467 std::unique_ptr<PasswordForm> password_form = | 1467 std::unique_ptr<PasswordForm> password_form = |
| 1468 LoadHTMLAndConvertForm(html, nullptr, true); | 1468 LoadHTMLAndConvertForm(html, nullptr, true); |
| 1469 ASSERT_TRUE(password_form); | 1469 ASSERT_TRUE(password_form); |
| 1470 EXPECT_FALSE(password_form->does_look_like_signup_form); | 1470 EXPECT_FALSE(password_form->does_look_like_signup_form); |
| 1471 } | 1471 } |
| 1472 | 1472 |
| 1473 TEST_F(MAYBE_PasswordFormConversionUtilsTest, TooManyFieldsToParseForm) { |
| 1474 PasswordFormBuilder builder(kTestFormActionURL); |
| 1475 for (size_t i = 0; i < form_util::kMaxParseableFields + 1; ++i) |
| 1476 builder.AddTextField("id", "value", "autocomplete"); |
| 1477 std::unique_ptr<PasswordForm> password_form = |
| 1478 LoadHTMLAndConvertForm(builder.ProduceHTML(), nullptr, false); |
| 1479 EXPECT_FALSE(password_form); |
| 1480 } |
| 1481 |
| 1473 } // namespace autofill | 1482 } // namespace autofill |
| OLD | NEW |