| Index: components/autofill/core/common/password_form_fill_data_unittest.cc
|
| diff --git a/components/autofill/core/common/password_form_fill_data_unittest.cc b/components/autofill/core/common/password_form_fill_data_unittest.cc
|
| index aafb4732d446803a7d1696ef752e5818476b6b5b..97355537cf7e85759c76f58c2b5e3f97fdcdaf83 100644
|
| --- a/components/autofill/core/common/password_form_fill_data_unittest.cc
|
| +++ b/components/autofill/core/common/password_form_fill_data_unittest.cc
|
| @@ -60,7 +60,7 @@ TEST(PasswordFormFillDataTest, TestSinglePreferredMatch) {
|
| EXPECT_TRUE(result.wait_for_username);
|
| // The preferred realm should be empty since it's the same as the realm of
|
| // the form.
|
| - EXPECT_EQ(result.preferred_realm, "");
|
| + EXPECT_EQ(std::string(), result.preferred_realm);
|
|
|
| PasswordFormFillData result2;
|
| InitPasswordFormFillData(form_on_page,
|
| @@ -103,13 +103,14 @@ TEST(PasswordFormFillDataTest, TestPublicSuffixDomainMatching) {
|
| preferred_match.password_element = ASCIIToUTF16("password");
|
| preferred_match.password_value = ASCIIToUTF16("test");
|
| preferred_match.submit_element = ASCIIToUTF16("");
|
| - preferred_match.signon_realm = "https://mobile.foo.com/";
|
| - preferred_match.original_signon_realm = "https://foo.com/";
|
| + preferred_match.signon_realm = "https://foo.com/";
|
| + preferred_match.is_public_suffix_match = true;
|
| preferred_match.ssl_valid = true;
|
| preferred_match.preferred = true;
|
| preferred_match.scheme = PasswordForm::SCHEME_HTML;
|
|
|
| - // Create a match that matches exactly, so |original_signon_realm| is not set.
|
| + // Create a match that matches exactly, so |is_public_suffix_match| has a
|
| + // default value false.
|
| scoped_ptr<PasswordForm> scoped_exact_match(new PasswordForm);
|
| PasswordForm& exact_match = *scoped_exact_match;
|
| exact_match.origin = GURL("https://foo.com/");
|
| @@ -125,7 +126,7 @@ TEST(PasswordFormFillDataTest, TestPublicSuffixDomainMatching) {
|
| exact_match.scheme = PasswordForm::SCHEME_HTML;
|
|
|
| // Create a match that was matched using public suffix, so
|
| - // |original_signon_realm| is set to where the result came from.
|
| + // |is_public_suffix_match| == true.
|
| scoped_ptr<PasswordForm> scoped_public_suffix_match(new PasswordForm);
|
| PasswordForm& public_suffix_match = *scoped_public_suffix_match;
|
| public_suffix_match.origin = GURL("https://foo.com/");
|
| @@ -135,7 +136,7 @@ TEST(PasswordFormFillDataTest, TestPublicSuffixDomainMatching) {
|
| public_suffix_match.password_element = ASCIIToUTF16("password");
|
| public_suffix_match.password_value = ASCIIToUTF16("test");
|
| public_suffix_match.submit_element = ASCIIToUTF16("");
|
| - public_suffix_match.original_signon_realm = "https://subdomain.foo.com/";
|
| + public_suffix_match.is_public_suffix_match = true;
|
| public_suffix_match.signon_realm = "https://foo.com/";
|
| public_suffix_match.ssl_valid = true;
|
| public_suffix_match.preferred = false;
|
| @@ -155,20 +156,19 @@ TEST(PasswordFormFillDataTest, TestPublicSuffixDomainMatching) {
|
| false,
|
| &result);
|
| EXPECT_TRUE(result.wait_for_username);
|
| - // The preferred realm should match the original signon realm from the
|
| + // The preferred realm should match the signon realm from the
|
| // preferred match so the user can see where the result came from.
|
| - EXPECT_EQ(result.preferred_realm,
|
| - preferred_match.original_signon_realm);
|
| + EXPECT_EQ(preferred_match.signon_realm, result.preferred_realm);
|
|
|
| // The realm of the exact match should be empty.
|
| PasswordFormFillData::LoginCollection::const_iterator iter =
|
| result.additional_logins.find(exact_match.username_value);
|
| - EXPECT_EQ(iter->second.realm, "");
|
| + EXPECT_EQ(std::string(), iter->second.realm);
|
|
|
| // The realm of the public suffix match should be set to the original signon
|
| // realm so the user can see where the result came from.
|
| iter = result.additional_logins.find(public_suffix_match.username_value);
|
| - EXPECT_EQ(iter->second.realm, public_suffix_match.original_signon_realm);
|
| + EXPECT_EQ(iter->second.realm, public_suffix_match.signon_realm);
|
| }
|
|
|
| } // namespace autofill
|
|
|