| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 profile_builder.SetProfileName(kFakeUserName); | 146 profile_builder.SetProfileName(kFakeUserName); |
| 147 profile_builder.AddTestingFactory( | 147 profile_builder.AddTestingFactory( |
| 148 ProfileOAuth2TokenServiceFactory::GetInstance(), | 148 ProfileOAuth2TokenServiceFactory::GetInstance(), |
| 149 BuildFakeProfileOAuth2TokenService); | 149 BuildFakeProfileOAuth2TokenService); |
| 150 profile_ = profile_builder.Build(); | 150 profile_ = profile_builder.Build(); |
| 151 token_service_ = static_cast<FakeProfileOAuth2TokenService*>( | 151 token_service_ = static_cast<FakeProfileOAuth2TokenService*>( |
| 152 ProfileOAuth2TokenServiceFactory::GetForProfile(profile())); | 152 ProfileOAuth2TokenServiceFactory::GetForProfile(profile())); |
| 153 token_service_->UpdateCredentials("", kRefreshToken); | 153 token_service_->UpdateCredentials("", kRefreshToken); |
| 154 | 154 |
| 155 profile()->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); | 155 profile()->GetPrefs()->SetBoolean(prefs::kArcSignedIn, true); |
| 156 profile()->GetPrefs()->SetBoolean(prefs::kArcTermsAccepted, true); |
| 156 | 157 |
| 157 const AccountId account_id( | 158 const AccountId account_id( |
| 158 AccountId::FromUserEmailGaiaId(kFakeUserName, "1234567890")); | 159 AccountId::FromUserEmailGaiaId(kFakeUserName, "1234567890")); |
| 159 GetFakeUserManager()->AddUser(account_id); | 160 GetFakeUserManager()->AddUser(account_id); |
| 160 GetFakeUserManager()->LoginUser(account_id); | 161 GetFakeUserManager()->LoginUser(account_id); |
| 161 | 162 |
| 162 // Set up ARC for test profile. | 163 // Set up ARC for test profile. |
| 163 ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(profile()); | 164 ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(profile()); |
| 164 } | 165 } |
| 165 | 166 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 prefs->SetBoolean(prefs::kArcEnabled, true); | 231 prefs->SetBoolean(prefs::kArcEnabled, true); |
| 231 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, | 232 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, |
| 232 base::Time::Max()); | 233 base::Time::Max()); |
| 233 ArcSessionManagerShutdownObserver observer; | 234 ArcSessionManagerShutdownObserver observer; |
| 234 observer.Wait(); | 235 observer.Wait(); |
| 235 ASSERT_EQ(ArcSessionManager::State::STOPPED, | 236 ASSERT_EQ(ArcSessionManager::State::STOPPED, |
| 236 ArcSessionManager::Get()->state()); | 237 ArcSessionManager::Get()->state()); |
| 237 } | 238 } |
| 238 | 239 |
| 239 } // namespace arc | 240 } // namespace arc |
| OLD | NEW |