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

Side by Side Diff: chrome/browser/chromeos/login/parallel_authenticator_unittest.cc

Issue 10854121: Fixes for handling of MockDBusThreadManager::GetSystemBus(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the build for sure Created 8 years, 4 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 (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/chromeos/login/parallel_authenticator.h" 5 #include "chrome/browser/chromeos/login/parallel_authenticator.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 SetAndResolveState(auth_, state_.release())); 310 SetAndResolveState(auth_, state_.release()));
311 } 311 }
312 312
313 TEST_F(ParallelAuthenticatorTest, ResolveOwnerNeededFailedMount) { 313 TEST_F(ParallelAuthenticatorTest, ResolveOwnerNeededFailedMount) {
314 FailOnLoginSuccess(); // Set failing on success as the default... 314 FailOnLoginSuccess(); // Set failing on success as the default...
315 LoginFailure failure = LoginFailure(LoginFailure::OWNER_REQUIRED); 315 LoginFailure failure = LoginFailure(LoginFailure::OWNER_REQUIRED);
316 ExpectLoginFailure(failure); 316 ExpectLoginFailure(failure);
317 317
318 MockDBusThreadManager* mock_dbus_thread_manager = 318 MockDBusThreadManager* mock_dbus_thread_manager =
319 new MockDBusThreadManager; 319 new MockDBusThreadManager;
320 EXPECT_CALL(*mock_dbus_thread_manager, GetSystemBus())
321 .WillRepeatedly(Return(reinterpret_cast<dbus::Bus*>(NULL)));
320 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager); 322 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager);
321 EXPECT_CALL(*mock_dbus_thread_manager->mock_cryptohome_client(), Unmount(_)) 323 EXPECT_CALL(*mock_dbus_thread_manager->mock_cryptohome_client(), Unmount(_))
322 .WillOnce(DoAll(SetArgPointee<0>(true), Return(true))); 324 .WillOnce(DoAll(SetArgPointee<0>(true), Return(true)));
323 325
324 CrosSettingsProvider* device_settings_provider; 326 CrosSettingsProvider* device_settings_provider;
325 StubCrosSettingsProvider stub_settings_provider; 327 StubCrosSettingsProvider stub_settings_provider;
326 // Set up state as though a cryptohome mount attempt has occurred 328 // Set up state as though a cryptohome mount attempt has occurred
327 // and succeeded but we are in safe mode and the current user is not owner. 329 // and succeeded but we are in safe mode and the current user is not owner.
328 state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); 330 state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE);
329 SetOwnerState(false, false); 331 SetOwnerState(false, false);
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 .RetiresOnSaturation(); 752 .RetiresOnSaturation();
751 EXPECT_CALL(*mock_cryptohome_library_, GetSystemSalt()) 753 EXPECT_CALL(*mock_cryptohome_library_, GetSystemSalt())
752 .WillOnce(Return(std::string())) 754 .WillOnce(Return(std::string()))
753 .RetiresOnSaturation(); 755 .RetiresOnSaturation();
754 756
755 auth_->AuthenticateToUnlock(username_, ""); 757 auth_->AuthenticateToUnlock(username_, "");
756 message_loop_.Run(); 758 message_loop_.Run();
757 } 759 }
758 760
759 } // namespace chromeos 761 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698