| Index: components/password_manager/core/browser/login_database_unittest.cc
|
| diff --git a/components/password_manager/core/browser/login_database_unittest.cc b/components/password_manager/core/browser/login_database_unittest.cc
|
| index 248f70cc2bfb89669baca62706d636e8283d6f33..5da4e81ce725f19552881bdcf4094286bbdf6180 100644
|
| --- a/components/password_manager/core/browser/login_database_unittest.cc
|
| +++ b/components/password_manager/core/browser/login_database_unittest.cc
|
| @@ -534,6 +534,28 @@ TEST_F(LoginDatabaseTest, TestFederatedMatchingWithoutPSLMatching) {
|
| EXPECT_THAT(result, testing::ElementsAre(Pointee(form2)));
|
| }
|
|
|
| +TEST_F(LoginDatabaseTest, TestFederatedPSLMatching) {
|
| + // Save a federated credential for the PSL matched site.
|
| + PasswordForm form;
|
| + form.origin = GURL("https://psl.example.com.com/");
|
| + form.action = GURL("https://psl.example.com/login");
|
| + form.signon_realm = "federation://psl.example.com/accounts.google.com";
|
| + form.username_value = ASCIIToUTF16("test1@gmail.com");
|
| + form.type = PasswordForm::TYPE_API;
|
| + form.federation_origin = url::Origin(GURL("https://accounts.google.com/"));
|
| + form.scheme = PasswordForm::SCHEME_HTML;
|
| + EXPECT_EQ(AddChangeForForm(form), db().AddLogin(form));
|
| +
|
| + // Match against.
|
| + PasswordStore::FormDigest form_request = {PasswordForm::SCHEME_HTML,
|
| + "https://example.com/",
|
| + GURL("https://example.com/login") };
|
| + std::vector<std::unique_ptr<PasswordForm>> result;
|
| + EXPECT_TRUE(db().GetLogins(form_request, &result));
|
| + form.is_public_suffix_match = true;
|
| + EXPECT_THAT(result, testing::ElementsAre(Pointee(form)));
|
| +}
|
| +
|
| // This test fails if the implementation of GetLogins uses GetCachedStatement
|
| // instead of GetUniqueStatement, since REGEXP is in use. See
|
| // http://crbug.com/248608.
|
|
|