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 "testing/gmock/include/gmock/gmock.h" | 5 #include "testing/gmock/include/gmock/gmock.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 base::FilePath db_file = db_dir_.path().AppendASCII("login.db"); | 1065 base::FilePath db_file = db_dir_.path().AppendASCII("login.db"); |
1066 ASSERT_TRUE(login_db_->Init(db_file)); | 1066 ASSERT_TRUE(login_db_->Init(db_file)); |
1067 | 1067 |
1068 keychain_ = new MockAppleKeychain(); | 1068 keychain_ = new MockAppleKeychain(); |
1069 | 1069 |
1070 store_ = new TestPasswordStoreMac( | 1070 store_ = new TestPasswordStoreMac( |
1071 base::MessageLoopProxy::current(), | 1071 base::MessageLoopProxy::current(), |
1072 base::MessageLoopProxy::current(), | 1072 base::MessageLoopProxy::current(), |
1073 keychain_, | 1073 keychain_, |
1074 login_db_); | 1074 login_db_); |
1075 ASSERT_TRUE(store_->Init(syncer::SyncableService::StartSyncFlare())); | 1075 ASSERT_TRUE(store_->Init(syncer::SyncableService::StartSyncFlare(), "")); |
1076 } | 1076 } |
1077 | 1077 |
1078 virtual void TearDown() { | 1078 virtual void TearDown() { |
1079 store_->Shutdown(); | 1079 store_->Shutdown(); |
1080 EXPECT_FALSE(store_->GetBackgroundTaskRunner()); | 1080 EXPECT_FALSE(store_->GetBackgroundTaskRunner()); |
1081 } | 1081 } |
1082 | 1082 |
1083 void WaitForStoreUpdate() { | 1083 void WaitForStoreUpdate() { |
1084 // Do a store-level query to wait for all the operations above to be done. | 1084 // Do a store-level query to wait for all the operations above to be done. |
1085 MockPasswordStoreConsumer consumer; | 1085 MockPasswordStoreConsumer consumer; |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 ASSERT_EQ(1u, matching_items.size()); | 1385 ASSERT_EQ(1u, matching_items.size()); |
1386 EXPECT_EQ(ASCIIToUTF16("joe_user"), matching_items[0]->username_value); | 1386 EXPECT_EQ(ASCIIToUTF16("joe_user"), matching_items[0]->username_value); |
1387 matching_items.clear(); | 1387 matching_items.clear(); |
1388 | 1388 |
1389 // Check the third-party password is still there. | 1389 // Check the third-party password is still there. |
1390 owned_keychain_adapter.SetFindsOnlyOwnedItems(false); | 1390 owned_keychain_adapter.SetFindsOnlyOwnedItems(false); |
1391 matching_items.get() = owned_keychain_adapter.PasswordsFillingForm( | 1391 matching_items.get() = owned_keychain_adapter.PasswordsFillingForm( |
1392 "http://some.domain.com/insecure.html", PasswordForm::SCHEME_HTML); | 1392 "http://some.domain.com/insecure.html", PasswordForm::SCHEME_HTML); |
1393 ASSERT_EQ(1u, matching_items.size()); | 1393 ASSERT_EQ(1u, matching_items.size()); |
1394 } | 1394 } |
OLD | NEW |