Chromium Code Reviews| 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 28fed75a9efcbb7b97119e5983f1177151145400..ab385b01b9bf47230d5b5762f4ece826b85169dc 100644 |
| --- a/chrome/browser/password_manager/password_store_mac_unittest.cc |
| +++ b/chrome/browser/password_manager/password_store_mac_unittest.cc |
| @@ -280,7 +280,7 @@ TEST_F(PasswordStoreMacInternalsTest, TestKeychainToFormTranslation) { |
| reinterpret_cast<SecKeychainItemRef>(i + 1); |
| PasswordForm form; |
| bool parsed = internal_keychain_helpers::FillPasswordFormFromKeychainItem( |
| - *keychain_, keychain_item, &form); |
| + *keychain_, keychain_item, &form, true); |
|
stuartmorgan
2013/09/30 22:39:12
You added a new param, but set it to true in every
Raghu Simha
2013/10/02 02:09:50
I've added a new test for this called TestFillPass
|
| EXPECT_TRUE(parsed) << "In iteration " << i; |
| @@ -319,7 +319,7 @@ TEST_F(PasswordStoreMacInternalsTest, TestKeychainToFormTranslation) { |
| SecKeychainItemRef keychain_item = reinterpret_cast<SecKeychainItemRef>(99); |
| PasswordForm form; |
| bool parsed = internal_keychain_helpers::FillPasswordFormFromKeychainItem( |
| - *keychain_, keychain_item, &form); |
| + *keychain_, keychain_item, &form, true); |
| EXPECT_FALSE(parsed); |
| } |
| } |
| @@ -388,8 +388,20 @@ TEST_F(PasswordStoreMacInternalsTest, TestKeychainSearch) { |
| // Check matches treating the form as a merging target. |
| EXPECT_EQ(test_data[i].expected_merge_matches > 0, |
| keychain_adapter.HasPasswordsMergeableWithForm(*query_form)); |
| - matching_items = keychain_adapter.PasswordsMergeableWithForm(*query_form); |
| + std::vector<SecKeychainItemRef> keychain_items; |
| + std::vector<MacKeychainPasswordFormAdapter::ItemFormPair> item_form_pairs = |
| + internal_keychain_helpers::GetAllKeychainItemAttributesAsPasswordForms( |
| + &keychain_items, *keychain_); |
| + matching_items = |
| + keychain_adapter.ExtractPasswordsMergeableWithForm(item_form_pairs, |
| + *query_form); |
| EXPECT_EQ(test_data[i].expected_merge_matches, matching_items.size()); |
| + STLDeleteContainerPairSecondPointers(item_form_pairs.begin(), |
| + item_form_pairs.end()); |
| + for (std::vector<SecKeychainItemRef>::iterator i = keychain_items.begin(); |
| + i != keychain_items.end(); ++i) { |
| + keychain_->Free(*i); |
| + } |
| STLDeleteElements(&matching_items); |
| // None of the pre-seeded items are owned by us, so none should match an |
| @@ -558,7 +570,8 @@ TEST_F(PasswordStoreMacInternalsTest, TestKeychainAdd) { |
| PasswordForm stored_form; |
| internal_keychain_helpers::FillPasswordFormFromKeychainItem(*keychain_, |
| keychain_item, |
| - &stored_form); |
| + &stored_form, |
| + true); |
| EXPECT_EQ(update_form->password_value, stored_form.password_value); |
| } |
| } |