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

Unified Diff: chrome/browser/chromeos/login/parallel_authenticator_unittest.cc

Issue 49773003: ChromeOS: Remove MockDBusThreadManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed tests. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/parallel_authenticator_unittest.cc
diff --git a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc
index 8b8ab4e8fb70d38e917ba5f13c77fe95218ecdbe..2bcf2434342138c4b116370b5a491da22489f1c7 100644
--- a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc
+++ b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc
@@ -53,8 +53,7 @@ class ParallelAuthenticatorTest : public testing::Test {
SystemSaltGetter::ConvertRawSaltToHexString(
FakeCryptohomeClient::GetStubSystemSalt()))),
user_manager_enabler_(new MockUserManager),
- mock_caller_(NULL),
- fake_dbus_thread_manager_(new FakeDBusThreadManager) {
+ mock_caller_(NULL) {
}
virtual ~ParallelAuthenticatorTest() {
@@ -67,8 +66,12 @@ class ParallelAuthenticatorTest : public testing::Test {
mock_caller_ = new cryptohome::MockAsyncMethodCaller;
cryptohome::AsyncMethodCaller::InitializeForTesting(mock_caller_);
- // Ownership of fake_dbus_thread_manager_ is taken.
- DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager_);
+ FakeDBusThreadManager* fake_dbus_thread_manager = new FakeDBusThreadManager;
+ fake_cryptohome_client_ = new FakeCryptohomeClient;
+ fake_dbus_thread_manager->SetCryptohomeClient(
+ scoped_ptr<CryptohomeClient>(fake_cryptohome_client_));
+ DBusThreadManager::InitializeForTesting(fake_dbus_thread_manager);
+
SystemSaltGetter::Initialize();
auth_ = new ParallelAuthenticator(&consumer_);
@@ -200,7 +203,7 @@ class ParallelAuthenticatorTest : public testing::Test {
MockConsumer consumer_;
scoped_refptr<ParallelAuthenticator> auth_;
scoped_ptr<TestAttemptState> state_;
- FakeDBusThreadManager* fake_dbus_thread_manager_;
+ FakeCryptohomeClient* fake_cryptohome_client_;
};
TEST_F(ParallelAuthenticatorTest, OnLoginSuccess) {
@@ -289,9 +292,7 @@ TEST_F(ParallelAuthenticatorTest, ResolveOwnerNeededFailedMount) {
LoginFailure failure = LoginFailure(LoginFailure::OWNER_REQUIRED);
ExpectLoginFailure(failure);
- FakeCryptohomeClient* fake_cryptohome_client =
- fake_dbus_thread_manager_->fake_cryptohome_client();
- fake_cryptohome_client->set_unmount_result(true);
+ fake_cryptohome_client_->set_unmount_result(true);
CrosSettingsProvider* device_settings_provider;
StubCrosSettingsProvider stub_settings_provider;
« no previous file with comments | « chrome/browser/chromeos/login/login_utils_browsertest.cc ('k') | chrome/browser/chromeos/login/screen_locker_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698