| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 token_service_->UpdateCredentials("", kRefreshToken); | 168 token_service_->UpdateCredentials("", kRefreshToken); |
| 169 | 169 |
| 170 profile()->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); | 170 profile()->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); |
| 171 | 171 |
| 172 const AccountId account_id( | 172 const AccountId account_id( |
| 173 AccountId::FromUserEmailGaiaId(kFakeUserName, "1234567890")); | 173 AccountId::FromUserEmailGaiaId(kFakeUserName, "1234567890")); |
| 174 GetFakeUserManager()->AddUser(account_id); | 174 GetFakeUserManager()->AddUser(account_id); |
| 175 GetFakeUserManager()->LoginUser(account_id); | 175 GetFakeUserManager()->LoginUser(account_id); |
| 176 | 176 |
| 177 // Set up ARC for test profile. | 177 // Set up ARC for test profile. |
| 178 std::unique_ptr<BooleanPrefMember> arc_enabled_pref = | |
| 179 base::MakeUnique<BooleanPrefMember>(); | |
| 180 arc_enabled_pref->Init(prefs::kArcEnabled, profile()->GetPrefs()); | 178 arc_enabled_pref->Init(prefs::kArcEnabled, profile()->GetPrefs()); |
| 181 ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( | 179 ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( |
| 182 multi_user_util::GetAccountIdFromProfile(profile()), | 180 multi_user_util::GetAccountIdFromProfile(profile())); |
| 183 std::move(arc_enabled_pref)); | |
| 184 ArcAuthService::Get()->OnPrimaryUserProfilePrepared(profile()); | 181 ArcAuthService::Get()->OnPrimaryUserProfilePrepared(profile()); |
| 185 } | 182 } |
| 186 | 183 |
| 187 void TearDownOnMainThread() override { | 184 void TearDownOnMainThread() override { |
| 188 ArcAuthService::Get()->Shutdown(); | 185 ArcAuthService::Get()->Shutdown(); |
| 189 ArcServiceManager::Get()->Shutdown(); | 186 ArcServiceManager::Get()->Shutdown(); |
| 190 profile_.reset(); | 187 profile_.reset(); |
| 191 user_manager_enabler_.reset(); | 188 user_manager_enabler_.reset(); |
| 192 } | 189 } |
| 193 | 190 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 244 |
| 248 prefs->SetBoolean(prefs::kArcEnabled, true); | 245 prefs->SetBoolean(prefs::kArcEnabled, true); |
| 249 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, | 246 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, |
| 250 base::Time::Max()); | 247 base::Time::Max()); |
| 251 ArcAuthServiceShutdownObserver observer; | 248 ArcAuthServiceShutdownObserver observer; |
| 252 observer.Wait(); | 249 observer.Wait(); |
| 253 ASSERT_EQ(ArcAuthService::State::STOPPED, ArcAuthService::Get()->state()); | 250 ASSERT_EQ(ArcAuthService::State::STOPPED, ArcAuthService::Get()->state()); |
| 254 } | 251 } |
| 255 | 252 |
| 256 } // namespace arc | 253 } // namespace arc |
| OLD | NEW |