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

Side by Side Diff: components/password_manager/core/common/credential_manager_types_unittest.cc

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Update new uses post-rebase Created 3 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/password_manager/core/common/credential_manager_types.h" 5 #include "components/password_manager/core/common/credential_manager_types.h"
6 6
7 #include "base/strings/string16.h" 7 #include "base/strings/string16.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "components/autofill/core/common/password_form.h" 9 #include "components/autofill/core/common/password_form.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 form = CreatePasswordFormFromCredentialInfo(info, origin_); 74 form = CreatePasswordFormFromCredentialInfo(info, origin_);
75 ASSERT_NE(nullptr, form.get()); 75 ASSERT_NE(nullptr, form.get());
76 76
77 EXPECT_EQ(info.icon, form->icon_url); 77 EXPECT_EQ(info.icon, form->icon_url);
78 EXPECT_EQ(info.name, form->display_name); 78 EXPECT_EQ(info.name, form->display_name);
79 EXPECT_EQ(origin_, form->origin); 79 EXPECT_EQ(origin_, form->origin);
80 EXPECT_EQ(autofill::PasswordForm::SCHEME_HTML, form->scheme); 80 EXPECT_EQ(autofill::PasswordForm::SCHEME_HTML, form->scheme);
81 81
82 // Local credentials have empty federation_origins, non-empty passwords, and 82 // Local credentials have empty federation_origins, non-empty passwords, and
83 // a signon realm that matches the origin. 83 // a signon realm that matches the origin.
84 EXPECT_TRUE(form->federation_origin.unique()); 84 EXPECT_TRUE(form->federation_origin.opaque());
85 EXPECT_EQ(info.password, form->password_value); 85 EXPECT_EQ(info.password, form->password_value);
86 EXPECT_EQ(origin_.spec(), form->signon_realm); 86 EXPECT_EQ(origin_.spec(), form->signon_realm);
87 } 87 }
88 88
89 TEST_F(CredentialManagerTypesTest, CreateObservedPasswordForm) { 89 TEST_F(CredentialManagerTypesTest, CreateObservedPasswordForm) {
90 std::unique_ptr<autofill::PasswordForm> form = 90 std::unique_ptr<autofill::PasswordForm> form =
91 CreateObservedPasswordFormFromOrigin(origin_); 91 CreateObservedPasswordFormFromOrigin(origin_);
92 92
93 ASSERT_TRUE(form); 93 ASSERT_TRUE(form);
94 EXPECT_EQ(GURL(), form->icon_url); 94 EXPECT_EQ(GURL(), form->icon_url);
95 EXPECT_EQ(base::string16(), form->display_name); 95 EXPECT_EQ(base::string16(), form->display_name);
96 EXPECT_EQ(origin_, form->origin); 96 EXPECT_EQ(origin_, form->origin);
97 EXPECT_EQ(autofill::PasswordForm::SCHEME_HTML, form->scheme); 97 EXPECT_EQ(autofill::PasswordForm::SCHEME_HTML, form->scheme);
98 EXPECT_TRUE(form->federation_origin.unique()); 98 EXPECT_TRUE(form->federation_origin.opaque());
99 EXPECT_EQ(base::string16(), form->password_value); 99 EXPECT_EQ(base::string16(), form->password_value);
100 EXPECT_EQ(origin_.spec(), form->signon_realm); 100 EXPECT_EQ(origin_.spec(), form->signon_realm);
101 } 101 }
102 102
103 } // namespace password_manager 103 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698