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

Unified Diff: chrome/browser/password_manager/login_database_unittest.cc

Issue 23857010: Revert "Revert 223907 "[password generation] Upload possible account cre..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: chrome/browser/password_manager/login_database_unittest.cc
diff --git a/chrome/browser/password_manager/login_database_unittest.cc b/chrome/browser/password_manager/login_database_unittest.cc
index 7b062a4e06452ec5e2723c5b1e22f06c87375d20..98bef927f576697990927079bc97cdc2a6ad4530 100644
--- a/chrome/browser/password_manager/login_database_unittest.cc
+++ b/chrome/browser/password_manager/login_database_unittest.cc
@@ -41,6 +41,15 @@ class LoginDatabaseTest : public testing::Test {
db_.public_suffix_domain_matching_ = enabled;
}
+ void FormsAreEqual(const PasswordForm& expected, const PasswordForm& actual) {
+ PasswordForm expected_copy(expected);
+#if defined(OS_MACOSX)
+ // On the Mac we should never be storing passwords in the database.
+ expected_copy.password_value = ASCIIToUTF16("");
+#endif
+ EXPECT_EQ(expected_copy, actual);
+ }
+
base::ScopedTempDir temp_dir_;
base::FilePath file_;
LoginDatabase db_;
@@ -66,11 +75,16 @@ TEST_F(LoginDatabaseTest, Logins) {
form.ssl_valid = false;
form.preferred = false;
form.scheme = PasswordForm::SCHEME_HTML;
+ form.times_used = 1;
+ form.form_data.name = ASCIIToUTF16("form_name");
+ form.form_data.method = ASCIIToUTF16("POST");
- // Add it and make sure it is there.
+ // Add it and make sure it is there and that all the fields were retrieved
+ // correctly.
EXPECT_TRUE(db_.AddLogin(form));
EXPECT_TRUE(db_.GetAutofillableLogins(&result));
EXPECT_EQ(1U, result.size());
+ FormsAreEqual(form, *result[0]);
delete result[0];
result.clear();
« no previous file with comments | « chrome/browser/password_manager/login_database.cc ('k') | chrome/browser/password_manager/password_form_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698