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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/scoped_observer.h" | 9 #include "base/scoped_observer.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 | 1444 |
1445 MockPasswordStoreConsumer consumer; | 1445 MockPasswordStoreConsumer consumer; |
1446 store_->GetLogins(m_form, PasswordStore::ALLOW_PROMPT, &consumer); | 1446 store_->GetLogins(m_form, PasswordStore::ALLOW_PROMPT, &consumer); |
1447 PasswordForm returned_form; | 1447 PasswordForm returned_form; |
1448 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(SizeIs(1u))) | 1448 EXPECT_CALL(consumer, OnGetPasswordStoreResultsConstRef(SizeIs(1u))) |
1449 .WillOnce( | 1449 .WillOnce( |
1450 DoAll(SaveACopyOfFirstForm(&returned_form), QuitUIMessageLoop())); | 1450 DoAll(SaveACopyOfFirstForm(&returned_form), QuitUIMessageLoop())); |
1451 base::MessageLoop::current()->Run(); | 1451 base::MessageLoop::current()->Run(); |
1452 | 1452 |
1453 // 3. Add the returned password for m.facebook.com. | 1453 // 3. Add the returned password for m.facebook.com. |
| 1454 returned_form.signon_realm = "http://m.facebook.com"; |
| 1455 returned_form.origin = GURL("http://m.facebook.com/index.html"); |
1454 EXPECT_EQ(AddChangeForForm(returned_form), | 1456 EXPECT_EQ(AddChangeForForm(returned_form), |
1455 login_db()->AddLogin(returned_form)); | 1457 login_db()->AddLogin(returned_form)); |
1456 owned_keychain_adapter.AddPassword(m_form); | 1458 owned_keychain_adapter.AddPassword(m_form); |
1457 | 1459 |
1458 // 4. Remove both passwords. | 1460 // 4. Remove both passwords. |
1459 store_->RemoveLogin(*www_form); | 1461 store_->RemoveLogin(*www_form); |
1460 store_->RemoveLogin(m_form); | 1462 store_->RemoveLogin(m_form); |
1461 FinishAsyncProcessing(); | 1463 FinishAsyncProcessing(); |
1462 | 1464 |
1463 // No trace of www.facebook.com. | 1465 // No trace of www.facebook.com. |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 histogram_tester_->ExpectUniqueSample( | 1854 histogram_tester_->ExpectUniqueSample( |
1853 "PasswordManager.KeychainMigration.NumPasswordsOnFailure", 1, 1); | 1855 "PasswordManager.KeychainMigration.NumPasswordsOnFailure", 1, 1); |
1854 histogram_tester_->ExpectUniqueSample( | 1856 histogram_tester_->ExpectUniqueSample( |
1855 "PasswordManager.KeychainMigration.NumFailedPasswords", 1, 1); | 1857 "PasswordManager.KeychainMigration.NumFailedPasswords", 1, 1); |
1856 histogram_tester_->ExpectUniqueSample( | 1858 histogram_tester_->ExpectUniqueSample( |
1857 "PasswordManager.KeychainMigration.NumChromeOwnedInaccessiblePasswords", | 1859 "PasswordManager.KeychainMigration.NumChromeOwnedInaccessiblePasswords", |
1858 2, 1); | 1860 2, 1); |
1859 // Don't test the encryption key access. | 1861 // Don't test the encryption key access. |
1860 histogram_tester_.reset(); | 1862 histogram_tester_.reset(); |
1861 } | 1863 } |
OLD | NEW |