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

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

Issue 906973007: PasswordStore: Clean up expectations about rewriting vectors of forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebased Created 5 years, 9 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/password_store_mac_unittest.cc
diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc
index 71ac708072e6375fd6ebb07d1a996d10da87e112..6cd6013e4c49d9122cbe1e0c21332a5226b2d8d8 100644
--- a/chrome/browser/password_manager/password_store_mac_unittest.cc
+++ b/chrome/browser/password_manager/password_store_mac_unittest.cc
@@ -491,7 +491,6 @@ TEST_F(PasswordStoreMacInternalsTest, TestKeychainSearch) {
keychain_adapter.PasswordsFillingForm(query_form->signon_realm,
query_form->scheme);
EXPECT_EQ(test_data[i].expected_fill_matches, matching_items.size());
- matching_items.clear();
// Check matches treating the form as a merging target.
EXPECT_EQ(test_data[i].expected_merge_matches > 0,
@@ -1247,9 +1246,8 @@ TEST_F(PasswordStoreMacTest, TestStoreUpdate) {
} else {
EXPECT_EQ(0U, matching_items.size()) << "iteration " << i;
}
- matching_items.clear();
- login_db()->GetLogins(*query_form, &matching_items);
+ EXPECT_TRUE(login_db()->GetLogins(*query_form, &matching_items));
EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size())
<< "iteration " << i;
}
@@ -1312,13 +1310,13 @@ TEST_F(PasswordStoreMacTest, TestDBKeychainAssociation) {
owned_keychain_adapter.PasswordsFillingForm(www_form->signon_realm,
www_form->scheme);
EXPECT_EQ(0u, matching_items.size());
- login_db()->GetLogins(*www_form, &matching_items);
+ EXPECT_TRUE(login_db()->GetLogins(*www_form, &matching_items));
EXPECT_EQ(0u, matching_items.size());
// No trace of m.facebook.com.
matching_items = owned_keychain_adapter.PasswordsFillingForm(
m_form.signon_realm, m_form.scheme);
EXPECT_EQ(0u, matching_items.size());
- login_db()->GetLogins(m_form, &matching_items);
+ EXPECT_TRUE(login_db()->GetLogins(m_form, &matching_items));
EXPECT_EQ(0u, matching_items.size());
}
@@ -1486,15 +1484,14 @@ TEST_F(PasswordStoreMacTest, TestRemoveLoginsMultiProfile) {
FinishAsyncProcessing();
ScopedVector<PasswordForm> matching_items;
- login_db()->GetLogins(*www_form, &matching_items);
+ EXPECT_TRUE(login_db()->GetLogins(*www_form, &matching_items));
EXPECT_EQ(1u, matching_items.size());
- matching_items.clear();
store_->RemoveLoginsCreatedBetween(base::Time(), base::Time());
FinishAsyncProcessing();
// Check the second facebook form is gone.
- login_db()->GetLogins(*www_form, &matching_items);
+ EXPECT_TRUE(login_db()->GetLogins(*www_form, &matching_items));
EXPECT_EQ(0u, matching_items.size());
// Check the first facebook form is still there.
@@ -1502,7 +1499,6 @@ TEST_F(PasswordStoreMacTest, TestRemoveLoginsMultiProfile) {
www_form->signon_realm, www_form->scheme);
ASSERT_EQ(1u, matching_items.size());
EXPECT_EQ(ASCIIToUTF16("joe_user"), matching_items[0]->username_value);
- matching_items.clear();
// Check the third-party password is still there.
owned_keychain_adapter.SetFindsOnlyOwnedItems(false);
@@ -1641,7 +1637,6 @@ TEST_F(PasswordStoreMacTest, SilentlyRemoveOrphanedForm) {
ScopedVector<autofill::PasswordForm> all_forms;
EXPECT_TRUE(login_db()->GetAutofillableLogins(&all_forms));
EXPECT_EQ(1u, all_forms.size());
- all_forms.clear();
::testing::Mock::VerifyAndClearExpectations(&mock_observer);
// 3. Get a password for www.facebook.com. The form is implicitly removed and
« no previous file with comments | « chrome/browser/password_manager/password_store_mac.cc ('k') | chrome/browser/password_manager/password_store_x.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698