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

Unified Diff: components/password_manager/content/browser/credential_manager_impl_unittest.cc

Issue 2398863003: Don't filter the federated credentials in the account chooser. (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/password_manager/core/browser/credential_manager_pending_request_task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/content/browser/credential_manager_impl_unittest.cc
diff --git a/components/password_manager/content/browser/credential_manager_impl_unittest.cc b/components/password_manager/content/browser/credential_manager_impl_unittest.cc
index c733a8b7e4b4058a9cab91787f9de9881b1c88d6..6a3808e892e53384fc3e1f0b256d209abb923e8d 100644
--- a/components/password_manager/content/browser/credential_manager_impl_unittest.cc
+++ b/components/password_manager/content/browser/credential_manager_impl_unittest.cc
@@ -713,8 +713,8 @@ TEST_F(CredentialManagerImplTest,
TEST_F(CredentialManagerImplTest,
CredentialManagerOnRequestCredentialWithDuplicates) {
- // Add 7 credentials. Two buckets of duplicates and one empty username. There
- // should be just two in the account chooser.
+ // Add 8 credentials. Two buckets of duplicates, one empty username and one
+ // federated one. There should be just 3 in the account chooser.
form_.preferred = true;
form_.username_element = base::ASCIIToUTF16("username_element");
store_->AddLogin(form_);
@@ -740,16 +740,24 @@ TEST_F(CredentialManagerImplTest,
duplicate.username_element = base::ASCIIToUTF16("username_element4");
duplicate.preferred = false;
store_->AddLogin(duplicate);
+ autofill::PasswordForm federated = origin_path_form_;
+ federated.password_value.clear();
+ federated.federation_origin = url::Origin(GURL("https://google.com/"));
+ federated.signon_realm =
+ "federation://" + federated.origin.host() + "/google.com";
+ store_->AddLogin(federated);
EXPECT_CALL(*client_, PromptUserToChooseCredentialsPtr(
UnorderedElementsAre(Pointee(form_),
- Pointee(origin_path_form_)),
+ Pointee(origin_path_form_),
+ Pointee(federated)),
testing::IsEmpty(), _, _));
bool called = false;
mojom::CredentialManagerError error;
base::Optional<CredentialInfo> credential;
std::vector<GURL> federations;
+ federations.push_back(GURL("https://google.com/"));
CallGet(false, true, federations,
base::Bind(&GetCredentialCallback, &called, &error, &credential));
« no previous file with comments | « no previous file | components/password_manager/core/browser/credential_manager_pending_request_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698