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

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

Issue 2127533003: Remove PasswordForm::ssl_valid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust //ios Created 4 years, 5 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
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/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 LoadHTMLAndConvertForm(html, nullptr, false); 253 LoadHTMLAndConvertForm(html, nullptr, false);
254 ASSERT_TRUE(password_form); 254 ASSERT_TRUE(password_form);
255 255
256 EXPECT_EQ("data:", password_form->signon_realm); 256 EXPECT_EQ("data:", password_form->signon_realm);
257 EXPECT_EQ(GURL(kTestFormActionURL), password_form->action); 257 EXPECT_EQ(GURL(kTestFormActionURL), password_form->action);
258 EXPECT_EQ(base::UTF8ToUTF16("username"), password_form->username_element); 258 EXPECT_EQ(base::UTF8ToUTF16("username"), password_form->username_element);
259 EXPECT_EQ(base::UTF8ToUTF16("johnsmith"), password_form->username_value); 259 EXPECT_EQ(base::UTF8ToUTF16("johnsmith"), password_form->username_value);
260 EXPECT_EQ(base::UTF8ToUTF16("password"), password_form->password_element); 260 EXPECT_EQ(base::UTF8ToUTF16("password"), password_form->password_element);
261 EXPECT_EQ(base::UTF8ToUTF16("secret"), password_form->password_value); 261 EXPECT_EQ(base::UTF8ToUTF16("secret"), password_form->password_value);
262 EXPECT_EQ(PasswordForm::SCHEME_HTML, password_form->scheme); 262 EXPECT_EQ(PasswordForm::SCHEME_HTML, password_form->scheme);
263 EXPECT_FALSE(password_form->ssl_valid);
264 EXPECT_FALSE(password_form->preferred); 263 EXPECT_FALSE(password_form->preferred);
265 EXPECT_FALSE(password_form->blacklisted_by_user); 264 EXPECT_FALSE(password_form->blacklisted_by_user);
266 EXPECT_EQ(PasswordForm::TYPE_MANUAL, password_form->type); 265 EXPECT_EQ(PasswordForm::TYPE_MANUAL, password_form->type);
267 } 266 }
268 267
269 TEST_F(MAYBE_PasswordFormConversionUtilsTest, DisabledFieldsAreIgnored) { 268 TEST_F(MAYBE_PasswordFormConversionUtilsTest, DisabledFieldsAreIgnored) {
270 PasswordFormBuilder builder(kTestFormActionURL); 269 PasswordFormBuilder builder(kTestFormActionURL);
271 builder.AddTextField("username", "johnsmith", nullptr); 270 builder.AddTextField("username", "johnsmith", nullptr);
272 builder.AddDisabledUsernameField(); 271 builder.AddDisabledUsernameField();
273 builder.AddDisabledPasswordField(); 272 builder.AddDisabledPasswordField();
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 builder.AddPasswordField("password", "secret", nullptr); 1450 builder.AddPasswordField("password", "secret", nullptr);
1452 std::string html = builder.ProduceHTML(); 1451 std::string html = builder.ProduceHTML();
1453 1452
1454 std::unique_ptr<PasswordForm> password_form = 1453 std::unique_ptr<PasswordForm> password_form =
1455 LoadHTMLAndConvertForm(html, nullptr, true); 1454 LoadHTMLAndConvertForm(html, nullptr, true);
1456 ASSERT_TRUE(password_form); 1455 ASSERT_TRUE(password_form);
1457 EXPECT_FALSE(password_form->does_look_like_signup_form); 1456 EXPECT_FALSE(password_form->does_look_like_signup_form);
1458 } 1457 }
1459 1458
1460 } // namespace autofill 1459 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698