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 "chrome/browser/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 loop.Run(); | 403 loop.Run(); |
404 EXPECT_EQ(policy::EnterpriseInstallAttributes::LOCK_SUCCESS, result); | 404 EXPECT_EQ(policy::EnterpriseInstallAttributes::LOCK_SUCCESS, result); |
405 RunUntilIdle(); | 405 RunUntilIdle(); |
406 } | 406 } |
407 | 407 |
408 void PrepareProfile(const std::string& username) { | 408 void PrepareProfile(const std::string& username) { |
409 // Normally this would happen during browser startup, but for tests | 409 // Normally this would happen during browser startup, but for tests |
410 // we need to trigger creation of Profile-related services. | 410 // we need to trigger creation of Profile-related services. |
411 ChromeBrowserMainExtraPartsProfiles:: | 411 ChromeBrowserMainExtraPartsProfiles:: |
412 EnsureBrowserContextKeyedServiceFactoriesBuilt(); | 412 EnsureBrowserContextKeyedServiceFactoriesBuilt(); |
| 413 ProfileManager::AllowGetDefaultProfile(); |
413 | 414 |
414 DeviceSettingsTestHelper device_settings_test_helper; | 415 DeviceSettingsTestHelper device_settings_test_helper; |
415 DeviceSettingsService::Get()->SetSessionManager( | 416 DeviceSettingsService::Get()->SetSessionManager( |
416 &device_settings_test_helper, new MockOwnerKeyUtil()); | 417 &device_settings_test_helper, new MockOwnerKeyUtil()); |
417 | 418 |
418 EXPECT_CALL(*cryptohome_, GetSystemSalt()) | 419 EXPECT_CALL(*cryptohome_, GetSystemSalt()) |
419 .WillRepeatedly(Return(std::string("stub_system_salt"))); | 420 .WillRepeatedly(Return(std::string("stub_system_salt"))); |
420 EXPECT_CALL(*mock_async_method_caller_, AsyncMount(_, _, _, _)) | 421 EXPECT_CALL(*mock_async_method_caller_, AsyncMount(_, _, _, _)) |
421 .WillRepeatedly(Return()); | 422 .WillRepeatedly(Return()); |
422 EXPECT_CALL(*mock_async_method_caller_, AsyncGetSanitizedUsername(_, _)) | 423 EXPECT_CALL(*mock_async_method_caller_, AsyncGetSanitizedUsername(_, _)) |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 } | 718 } |
718 | 719 |
719 INSTANTIATE_TEST_CASE_P( | 720 INSTANTIATE_TEST_CASE_P( |
720 LoginUtilsBlockingLoginTestInstance, | 721 LoginUtilsBlockingLoginTestInstance, |
721 LoginUtilsBlockingLoginTest, | 722 LoginUtilsBlockingLoginTest, |
722 testing::Values(0, 1, 2, 3, 4, 5)); | 723 testing::Values(0, 1, 2, 3, 4, 5)); |
723 | 724 |
724 } // namespace | 725 } // namespace |
725 | 726 |
726 } | 727 } |
OLD | NEW |