| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = | 178 std::unique_ptr<BooleanPrefMember> arc_enabled_pref = |
| 179 base::MakeUnique<BooleanPrefMember>(); | 179 base::MakeUnique<BooleanPrefMember>(); |
| 180 arc_enabled_pref->Init(prefs::kArcEnabled, profile()->GetPrefs()); | 180 arc_enabled_pref->Init(prefs::kArcEnabled, profile()->GetPrefs()); |
| 181 ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( | 181 ArcServiceManager::Get()->OnPrimaryUserProfilePrepared( |
| 182 multi_user_util::GetAccountIdFromProfile(profile()), | 182 multi_user_util::GetAccountIdFromProfile(profile()), |
| 183 std::move(arc_enabled_pref)); | 183 std::move(arc_enabled_pref), profile()->GetPrefs()); |
| 184 ArcAuthService::Get()->OnPrimaryUserProfilePrepared(profile()); | 184 ArcAuthService::Get()->OnPrimaryUserProfilePrepared(profile()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void TearDownOnMainThread() override { | 187 void TearDownOnMainThread() override { |
| 188 ArcAuthService::Get()->Shutdown(); | 188 ArcAuthService::Get()->Shutdown(); |
| 189 ArcServiceManager::Get()->Shutdown(); | 189 ArcServiceManager::Get()->Shutdown(); |
| 190 profile_.reset(); | 190 profile_.reset(); |
| 191 user_manager_enabler_.reset(); | 191 user_manager_enabler_.reset(); |
| 192 } | 192 } |
| 193 | 193 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 prefs->SetBoolean(prefs::kArcEnabled, true); | 248 prefs->SetBoolean(prefs::kArcEnabled, true); |
| 249 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, | 249 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, |
| 250 base::Time::Max()); | 250 base::Time::Max()); |
| 251 ArcAuthServiceShutdownObserver observer; | 251 ArcAuthServiceShutdownObserver observer; |
| 252 observer.Wait(); | 252 observer.Wait(); |
| 253 ASSERT_EQ(ArcAuthService::State::STOPPED, ArcAuthService::Get()->state()); | 253 ASSERT_EQ(ArcAuthService::State::STOPPED, ArcAuthService::Get()->state()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace arc | 256 } // namespace arc |
| OLD | NEW |