Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc

Issue 477663004: Merged FakedDBusThreadManager with DBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/login/auth/chrome_cryptohome_authenticator.h" 5 #include "chrome/browser/chromeos/login/auth/chrome_cryptohome_authenticator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/chromeos/settings/cros_settings.h" 21 #include "chrome/browser/chromeos/settings/cros_settings.h"
22 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" 22 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h"
23 #include "chrome/browser/chromeos/settings/mock_owner_key_util.h" 23 #include "chrome/browser/chromeos/settings/mock_owner_key_util.h"
24 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" 24 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
25 #include "chrome/test/base/testing_browser_process.h" 25 #include "chrome/test/base/testing_browser_process.h"
26 #include "chrome/test/base/testing_profile.h" 26 #include "chrome/test/base/testing_profile.h"
27 #include "chrome/test/base/testing_profile_manager.h" 27 #include "chrome/test/base/testing_profile_manager.h"
28 #include "chromeos/chromeos_switches.h" 28 #include "chromeos/chromeos_switches.h"
29 #include "chromeos/cryptohome/mock_async_method_caller.h" 29 #include "chromeos/cryptohome/mock_async_method_caller.h"
30 #include "chromeos/cryptohome/system_salt_getter.h" 30 #include "chromeos/cryptohome/system_salt_getter.h"
31 #include "chromeos/dbus/dbus_thread_manager.h"
31 #include "chromeos/dbus/fake_cryptohome_client.h" 32 #include "chromeos/dbus/fake_cryptohome_client.h"
32 #include "chromeos/dbus/fake_dbus_thread_manager.h"
33 #include "chromeos/login/auth/key.h" 33 #include "chromeos/login/auth/key.h"
34 #include "chromeos/login/auth/mock_auth_status_consumer.h" 34 #include "chromeos/login/auth/mock_auth_status_consumer.h"
35 #include "chromeos/login/auth/mock_url_fetchers.h" 35 #include "chromeos/login/auth/mock_url_fetchers.h"
36 #include "chromeos/login/auth/test_attempt_state.h" 36 #include "chromeos/login/auth/test_attempt_state.h"
37 #include "chromeos/login/auth/user_context.h" 37 #include "chromeos/login/auth/user_context.h"
38 #include "content/public/test/test_browser_thread_bundle.h" 38 #include "content/public/test/test_browser_thread_bundle.h"
39 #include "crypto/nss_util_internal.h" 39 #include "crypto/nss_util_internal.h"
40 #include "crypto/scoped_test_nss_chromeos_user.h" 40 #include "crypto/scoped_test_nss_chromeos_user.h"
41 #include "google_apis/gaia/mock_url_fetcher_factory.h" 41 #include "google_apis/gaia/mock_url_fetcher_factory.h"
42 #include "net/base/net_errors.h" 42 #include "net/base/net_errors.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 virtual ~CryptohomeAuthenticatorTest() {} 136 virtual ~CryptohomeAuthenticatorTest() {}
137 137
138 virtual void SetUp() { 138 virtual void SetUp() {
139 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kLoginManager); 139 CommandLine::ForCurrentProcess()->AppendSwitch(switches::kLoginManager);
140 140
141 mock_caller_ = new cryptohome::MockAsyncMethodCaller; 141 mock_caller_ = new cryptohome::MockAsyncMethodCaller;
142 cryptohome::AsyncMethodCaller::InitializeForTesting(mock_caller_); 142 cryptohome::AsyncMethodCaller::InitializeForTesting(mock_caller_);
143 143
144 FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager;
145 fake_cryptohome_client_ = new FakeCryptohomeClient; 144 fake_cryptohome_client_ = new FakeCryptohomeClient;
146 fake_dbus_thread_manager->SetCryptohomeClient( 145 chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient(
147 scoped_ptr<CryptohomeClient>(fake_cryptohome_client_)); 146 scoped_ptr<CryptohomeClient>(fake_cryptohome_client_));
148 DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager);
149 147
150 SystemSaltGetter::Initialize(); 148 SystemSaltGetter::Initialize();
151 149
152 OwnerSettingsService::SetOwnerKeyUtilForTesting(owner_key_util_); 150 OwnerSettingsService::SetOwnerKeyUtilForTesting(owner_key_util_);
153 151
154 auth_ = new ChromeCryptohomeAuthenticator(&consumer_); 152 auth_ = new ChromeCryptohomeAuthenticator(&consumer_);
155 state_.reset(new TestAttemptState(user_context_, false)); 153 state_.reset(new TestAttemptState(user_context_, false));
156 } 154 }
157 155
158 // Tears down the test fixture. 156 // Tears down the test fixture.
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 mock_caller_->SetUp(true, cryptohome::MOUNT_ERROR_NONE); 726 mock_caller_->SetUp(true, cryptohome::MOUNT_ERROR_NONE);
729 EXPECT_CALL(*mock_caller_, AsyncCheckKey(user_context_.GetUserID(), _, _)) 727 EXPECT_CALL(*mock_caller_, AsyncCheckKey(user_context_.GetUserID(), _, _))
730 .Times(1) 728 .Times(1)
731 .RetiresOnSaturation(); 729 .RetiresOnSaturation();
732 730
733 auth_->AuthenticateToUnlock(user_context_); 731 auth_->AuthenticateToUnlock(user_context_);
734 base::MessageLoop::current()->Run(); 732 base::MessageLoop::current()->Run();
735 } 733 }
736 734
737 } // namespace chromeos 735 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/customization_document_unittest.cc ('k') | chrome/browser/chromeos/login/crash_restore_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698