Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(810)

Side by Side Diff: components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc

Issue 2715433004: [Password Manager] Check the success of extracting FormData in PasswordForm creation (Closed)
Patch Set: Fixed compilation error in tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/autofill/content/renderer/password_form_conversion_utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/autofill/content/renderer/password_form_conversion_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698