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

Unified Diff: components/autofill/core/common/password_form_fill_data_unittest.cc

Issue 1314903003: Updating of all entries in PasswordManager of the same credentials on password update (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed strings from progress loader Created 5 years, 3 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
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..055a92d3321aea6f78c381d1ee4c2f6eac8da836 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("", result.preferred_realm);
vabr (Chromium) 2015/09/24 15:17:33 nit: "" -> std::string() (Also on line 165.) Note
dvadym 2015/09/25 10:19:52 Done.
PasswordFormFillData result2;
InitPasswordFormFillData(form_on_page,
@@ -103,13 +103,13 @@ 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| == false.
vabr (Chromium) 2015/09/24 15:17:33 Either set it explicitly to false, or note that fa
dvadym 2015/09/25 10:19:52 I've writtten "So|is_public_suffix_match| has defa
scoped_ptr<PasswordForm> scoped_exact_match(new PasswordForm);
PasswordForm& exact_match = *scoped_exact_match;
exact_match.origin = GURL("https://foo.com/");
@@ -125,7 +125,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 +135,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 +155,20 @@ 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(result.preferred_realm, preferred_match.signon_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("", 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(public_suffix_match.signon_realm, iter->second.realm);
+ EXPECT_TRUE(public_suffix_match.IsPublicSuffixMatch());
}
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698