| 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/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 base::FilePath db_file = db_dir_.path().AppendASCII("login.db"); | 1058 base::FilePath db_file = db_dir_.path().AppendASCII("login.db"); |
| 1059 ASSERT_TRUE(login_db_->Init(db_file)); | 1059 ASSERT_TRUE(login_db_->Init(db_file)); |
| 1060 | 1060 |
| 1061 keychain_ = new MockAppleKeychain(); | 1061 keychain_ = new MockAppleKeychain(); |
| 1062 | 1062 |
| 1063 store_ = new TestPasswordStoreMac( | 1063 store_ = new TestPasswordStoreMac( |
| 1064 base::MessageLoopProxy::current(), | 1064 base::MessageLoopProxy::current(), |
| 1065 base::MessageLoopProxy::current(), | 1065 base::MessageLoopProxy::current(), |
| 1066 keychain_, | 1066 keychain_, |
| 1067 login_db_); | 1067 login_db_); |
| 1068 ASSERT_TRUE(store_->Init(syncer::SyncableService::StartSyncFlare(), "")); | 1068 ASSERT_TRUE(store_->Init(syncer::SyncableService::StartSyncFlare())); |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 virtual void TearDown() { | 1071 virtual void TearDown() { |
| 1072 store_->Shutdown(); | 1072 store_->Shutdown(); |
| 1073 EXPECT_FALSE(store_->GetBackgroundTaskRunner().get()); | 1073 EXPECT_FALSE(store_->GetBackgroundTaskRunner().get()); |
| 1074 } | 1074 } |
| 1075 | 1075 |
| 1076 void WaitForStoreUpdate() { | 1076 void WaitForStoreUpdate() { |
| 1077 // Do a store-level query to wait for all the operations above to be done. | 1077 // Do a store-level query to wait for all the operations above to be done. |
| 1078 MockPasswordStoreConsumer consumer; | 1078 MockPasswordStoreConsumer consumer; |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 ASSERT_EQ(1u, matching_items.size()); | 1436 ASSERT_EQ(1u, matching_items.size()); |
| 1437 EXPECT_EQ(ASCIIToUTF16("joe_user"), matching_items[0]->username_value); | 1437 EXPECT_EQ(ASCIIToUTF16("joe_user"), matching_items[0]->username_value); |
| 1438 matching_items.clear(); | 1438 matching_items.clear(); |
| 1439 | 1439 |
| 1440 // Check the third-party password is still there. | 1440 // Check the third-party password is still there. |
| 1441 owned_keychain_adapter.SetFindsOnlyOwnedItems(false); | 1441 owned_keychain_adapter.SetFindsOnlyOwnedItems(false); |
| 1442 matching_items.get() = owned_keychain_adapter.PasswordsFillingForm( | 1442 matching_items.get() = owned_keychain_adapter.PasswordsFillingForm( |
| 1443 "http://some.domain.com/insecure.html", PasswordForm::SCHEME_HTML); | 1443 "http://some.domain.com/insecure.html", PasswordForm::SCHEME_HTML); |
| 1444 ASSERT_EQ(1u, matching_items.size()); | 1444 ASSERT_EQ(1u, matching_items.size()); |
| 1445 } | 1445 } |
| OLD | NEW |