| 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // a valid login token, while on other platforms, the login refresh token | 120 // a valid login token, while on other platforms, the login refresh token |
| 121 // is specified directly. | 121 // is specified directly. |
| 122 #if defined(OS_ANDROID) | 122 #if defined(OS_ANDROID) |
| 123 GetTokenService()->UpdateCredentials( | 123 GetTokenService()->UpdateCredentials( |
| 124 AccountTrackerService::PickAccountIdForAccount( | 124 AccountTrackerService::PickAccountIdForAccount( |
| 125 profile_.get()->GetPrefs(), kTestGaiaId, kTestUser), | 125 profile_.get()->GetPrefs(), kTestGaiaId, kTestUser), |
| 126 "oauth2_login_refresh_token"); | 126 "oauth2_login_refresh_token"); |
| 127 #endif | 127 #endif |
| 128 service->RegisterForPolicy( | 128 service->RegisterForPolicy( |
| 129 kTestUser, | 129 kTestUser, |
| 130 #if !defined(OS_ANDROID) | 130 #if defined(OS_ANDROID) |
| 131 kTestGaiaId, |
| 132 #else |
| 131 "mock_oauth_token", | 133 "mock_oauth_token", |
| 132 #endif | 134 #endif |
| 133 base::Bind(&UserPolicySigninServiceTest::OnRegisterCompleted, | 135 base::Bind(&UserPolicySigninServiceTest::OnRegisterCompleted, |
| 134 base::Unretained(this))); | 136 base::Unretained(this))); |
| 135 ASSERT_TRUE(IsRequestActive()); | 137 ASSERT_TRUE(IsRequestActive()); |
| 136 } | 138 } |
| 137 | 139 |
| 138 void SetUp() override { | 140 void SetUp() override { |
| 139 UserPolicySigninServiceFactory::SetDeviceManagementServiceForTesting( | 141 UserPolicySigninServiceFactory::SetDeviceManagementServiceForTesting( |
| 140 &device_management_service_); | 142 &device_management_service_); |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 base::RunLoop().RunUntilIdle(); | 817 base::RunLoop().RunUntilIdle(); |
| 816 EXPECT_FALSE(manager_->IsClientRegistered()); | 818 EXPECT_FALSE(manager_->IsClientRegistered()); |
| 817 #if !defined(OS_ANDROID) | 819 #if !defined(OS_ANDROID) |
| 818 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); | 820 EXPECT_FALSE(signin_manager_->IsSignoutProhibited()); |
| 819 #endif | 821 #endif |
| 820 } | 822 } |
| 821 | 823 |
| 822 } // namespace | 824 } // namespace |
| 823 | 825 |
| 824 } // namespace policy | 826 } // namespace policy |
| OLD | NEW |