OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/password_manager/password_store_mac.h" | 5 #include "chrome/browser/password_manager/password_store_mac.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 keychain_adapter.HasPasswordsMergeableWithForm(*query_form)); | 505 keychain_adapter.HasPasswordsMergeableWithForm(*query_form)); |
506 std::vector<SecKeychainItemRef> keychain_items; | 506 std::vector<SecKeychainItemRef> keychain_items; |
507 std::vector<internal_keychain_helpers::ItemFormPair> item_form_pairs = | 507 std::vector<internal_keychain_helpers::ItemFormPair> item_form_pairs = |
508 internal_keychain_helpers:: | 508 internal_keychain_helpers:: |
509 ExtractAllKeychainItemAttributesIntoPasswordForms(&keychain_items, | 509 ExtractAllKeychainItemAttributesIntoPasswordForms(&keychain_items, |
510 *keychain_); | 510 *keychain_); |
511 matching_items = | 511 matching_items = |
512 internal_keychain_helpers::ExtractPasswordsMergeableWithForm( | 512 internal_keychain_helpers::ExtractPasswordsMergeableWithForm( |
513 *keychain_, item_form_pairs, *query_form); | 513 *keychain_, item_form_pairs, *query_form); |
514 EXPECT_EQ(test_data[i].expected_merge_matches, matching_items.size()); | 514 EXPECT_EQ(test_data[i].expected_merge_matches, matching_items.size()); |
515 STLDeleteContainerPairSecondPointers(item_form_pairs.begin(), | 515 base::STLDeleteContainerPairSecondPointers(item_form_pairs.begin(), |
516 item_form_pairs.end()); | 516 item_form_pairs.end()); |
517 for (std::vector<SecKeychainItemRef>::iterator i = keychain_items.begin(); | 517 for (std::vector<SecKeychainItemRef>::iterator i = keychain_items.begin(); |
518 i != keychain_items.end(); ++i) { | 518 i != keychain_items.end(); ++i) { |
519 keychain_->Free(*i); | 519 keychain_->Free(*i); |
520 } | 520 } |
521 | 521 |
522 // None of the pre-seeded items are owned by us, so none should match an | 522 // None of the pre-seeded items are owned by us, so none should match an |
523 // owned-passwords-only search. | 523 // owned-passwords-only search. |
524 matching_items = owned_keychain_adapter.PasswordsFillingForm( | 524 matching_items = owned_keychain_adapter.PasswordsFillingForm( |
525 query_form->signon_realm, query_form->scheme); | 525 query_form->signon_realm, query_form->scheme); |
526 EXPECT_EQ(0U, matching_items.size()); | 526 EXPECT_EQ(0U, matching_items.size()); |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 histogram_tester_->ExpectUniqueSample( | 2081 histogram_tester_->ExpectUniqueSample( |
2082 "PasswordManager.KeychainMigration.NumPasswordsOnFailure", 1, 1); | 2082 "PasswordManager.KeychainMigration.NumPasswordsOnFailure", 1, 1); |
2083 histogram_tester_->ExpectUniqueSample( | 2083 histogram_tester_->ExpectUniqueSample( |
2084 "PasswordManager.KeychainMigration.NumFailedPasswords", 1, 1); | 2084 "PasswordManager.KeychainMigration.NumFailedPasswords", 1, 1); |
2085 histogram_tester_->ExpectUniqueSample( | 2085 histogram_tester_->ExpectUniqueSample( |
2086 "PasswordManager.KeychainMigration.NumChromeOwnedInaccessiblePasswords", | 2086 "PasswordManager.KeychainMigration.NumChromeOwnedInaccessiblePasswords", |
2087 2, 1); | 2087 2, 1); |
2088 // Don't test the encryption key access. | 2088 // Don't test the encryption key access. |
2089 histogram_tester_.reset(); | 2089 histogram_tester_.reset(); |
2090 } | 2090 } |
OLD | NEW |