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 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // Second start, no fetching code is expected. | 287 // Second start, no fetching code is expected. |
288 auth_service()->Shutdown(); | 288 auth_service()->Shutdown(); |
289 EXPECT_EQ(ArcAuthService::State::NOT_INITIALIZED, auth_service()->state()); | 289 EXPECT_EQ(ArcAuthService::State::NOT_INITIALIZED, auth_service()->state()); |
290 EXPECT_FALSE(bridge_service()->ready()); | 290 EXPECT_FALSE(bridge_service()->ready()); |
291 auth_service()->OnPrimaryUserProfilePrepared(profile()); | 291 auth_service()->OnPrimaryUserProfilePrepared(profile()); |
292 EXPECT_TRUE(prefs->GetBoolean(prefs::kArcSignedIn)); | 292 EXPECT_TRUE(prefs->GetBoolean(prefs::kArcSignedIn)); |
293 EXPECT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state()); | 293 EXPECT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state()); |
294 EXPECT_TRUE(bridge_service()->ready()); | 294 EXPECT_TRUE(bridge_service()->ready()); |
295 | 295 |
296 // Report failure. | 296 // Report failure. |
297 auth_service()->OnSignInFailed(mojom::ArcSignInFailureReason::NETWORK_ERROR); | 297 auth_service()->OnSignInFailed( |
| 298 mojom::ArcSignInFailureReason::GMS_NETWORK_ERROR); |
298 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn)); | 299 EXPECT_FALSE(prefs->GetBoolean(prefs::kArcSignedIn)); |
299 EXPECT_EQ(ArcAuthService::State::STOPPED, auth_service()->state()); | 300 EXPECT_EQ(ArcAuthService::State::STOPPED, auth_service()->state()); |
300 EXPECT_FALSE(bridge_service()->ready()); | 301 EXPECT_FALSE(bridge_service()->ready()); |
301 | 302 |
302 // Correctly stop service. | 303 // Correctly stop service. |
303 auth_service()->Shutdown(); | 304 auth_service()->Shutdown(); |
304 } | 305 } |
305 | 306 |
306 TEST_F(ArcAuthServiceTest, DisabledForDeviceLocalAccount) { | 307 TEST_F(ArcAuthServiceTest, DisabledForDeviceLocalAccount) { |
307 PrefService* const prefs = profile()->GetPrefs(); | 308 PrefService* const prefs = profile()->GetPrefs(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 second_profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); | 351 second_profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true); |
351 | 352 |
352 // Check that non-primary user can't use Arc. | 353 // Check that non-primary user can't use Arc. |
353 EXPECT_FALSE(chromeos::ProfileHelper::IsPrimaryProfile(second_profile.get())); | 354 EXPECT_FALSE(chromeos::ProfileHelper::IsPrimaryProfile(second_profile.get())); |
354 EXPECT_FALSE(ArcAppListPrefs::Get(second_profile.get())); | 355 EXPECT_FALSE(ArcAppListPrefs::Get(second_profile.get())); |
355 | 356 |
356 auth_service()->Shutdown(); | 357 auth_service()->Shutdown(); |
357 } | 358 } |
358 | 359 |
359 } // namespace arc | 360 } // namespace arc |
OLD | NEW |