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/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 PasswordStoreMacTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} | 1031 PasswordStoreMacTest() : ui_thread_(BrowserThread::UI, &message_loop_) {} |
1032 | 1032 |
1033 virtual void SetUp() { | 1033 virtual void SetUp() { |
1034 login_db_ = new LoginDatabase(); | 1034 login_db_ = new LoginDatabase(); |
1035 ASSERT_TRUE(db_dir_.CreateUniqueTempDir()); | 1035 ASSERT_TRUE(db_dir_.CreateUniqueTempDir()); |
1036 base::FilePath db_file = db_dir_.path().AppendASCII("login.db"); | 1036 base::FilePath db_file = db_dir_.path().AppendASCII("login.db"); |
1037 ASSERT_TRUE(login_db_->Init(db_file)); | 1037 ASSERT_TRUE(login_db_->Init(db_file)); |
1038 | 1038 |
1039 keychain_ = new MockAppleKeychain(); | 1039 keychain_ = new MockAppleKeychain(); |
1040 | 1040 |
1041 store_ = new PasswordStoreMac(keychain_, login_db_); | 1041 store_ = new PasswordStoreMac( |
| 1042 base::MessageLoopProxy::current(), |
| 1043 base::MessageLoopProxy::current(), |
| 1044 keychain_, |
| 1045 login_db_); |
1042 ASSERT_TRUE(store_->Init()); | 1046 ASSERT_TRUE(store_->Init()); |
1043 } | 1047 } |
1044 | 1048 |
1045 virtual void TearDown() { | 1049 virtual void TearDown() { |
1046 store_->ShutdownOnUIThread(); | 1050 store_->ShutdownOnUIThread(); |
1047 base::MessageLoop::current()->PostTask(FROM_HERE, | 1051 base::MessageLoop::current()->PostTask(FROM_HERE, |
1048 base::MessageLoop::QuitClosure()); | 1052 base::MessageLoop::QuitClosure()); |
1049 base::MessageLoop::current()->Run(); | 1053 base::MessageLoop::current()->Run(); |
1050 } | 1054 } |
1051 | 1055 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1221 EXPECT_EQ(0u, matching_items.size()); | 1225 EXPECT_EQ(0u, matching_items.size()); |
1222 login_db_->GetLogins(*www_form, &matching_items); | 1226 login_db_->GetLogins(*www_form, &matching_items); |
1223 EXPECT_EQ(0u, matching_items.size()); | 1227 EXPECT_EQ(0u, matching_items.size()); |
1224 // No trace of m.facebook.com. | 1228 // No trace of m.facebook.com. |
1225 matching_items = owned_keychain_adapter.PasswordsFillingForm( | 1229 matching_items = owned_keychain_adapter.PasswordsFillingForm( |
1226 m_form.signon_realm, m_form.scheme); | 1230 m_form.signon_realm, m_form.scheme); |
1227 EXPECT_EQ(0u, matching_items.size()); | 1231 EXPECT_EQ(0u, matching_items.size()); |
1228 login_db_->GetLogins(m_form, &matching_items); | 1232 login_db_->GetLogins(m_form, &matching_items); |
1229 EXPECT_EQ(0u, matching_items.size()); | 1233 EXPECT_EQ(0u, matching_items.size()); |
1230 } | 1234 } |
OLD | NEW |