Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4324)

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service_unittest.cc

Issue 2201493002: [Merge to M53] arc: Implement safe access to ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@2785
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | chrome/browser/chromeos/arc/arc_support_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc b/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
index fcb0351a236c5148a2d7ec651b11469274dd76e7..897bec90750a10e323af78d0a25223bf78297a10 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
@@ -149,13 +149,13 @@ TEST_F(ArcAuthServiceTest, DisabledForEphemeralDataUsers) {
fake_user_manager->AddUser(fake_user_manager->GetGuestAccountId());
fake_user_manager->SwitchActiveUser(fake_user_manager->GetGuestAccountId());
auth_service()->OnPrimaryUserProfilePrepared(profile());
- ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::NOT_INITIALIZED, auth_service()->state());
fake_user_manager->AddUser(chromeos::login::DemoAccountId());
fake_user_manager->SwitchActiveUser(chromeos::login::DemoAccountId());
auth_service()->Shutdown();
auth_service()->OnPrimaryUserProfilePrepared(profile());
- ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::NOT_INITIALIZED, auth_service()->state());
const AccountId public_account_id(
AccountId::FromUserEmail("public_user@gmail.com"));
@@ -163,16 +163,17 @@ TEST_F(ArcAuthServiceTest, DisabledForEphemeralDataUsers) {
fake_user_manager->SwitchActiveUser(public_account_id);
auth_service()->Shutdown();
auth_service()->OnPrimaryUserProfilePrepared(profile());
- ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::NOT_INITIALIZED, auth_service()->state());
const AccountId not_in_list_account_id(
AccountId::FromUserEmail("not_in_list_user@gmail.com"));
+ fake_user_manager->set_ephemeral_users_enabled(true);
fake_user_manager->AddUser(not_in_list_account_id);
fake_user_manager->SwitchActiveUser(not_in_list_account_id);
fake_user_manager->RemoveUserFromList(not_in_list_account_id);
auth_service()->Shutdown();
auth_service()->OnPrimaryUserProfilePrepared(profile());
- ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::NOT_INITIALIZED, auth_service()->state());
// Correctly stop service.
auth_service()->Shutdown();
@@ -330,7 +331,7 @@ TEST_F(ArcAuthServiceTest, DisabledForDeviceLocalAccount) {
// Check that user without GAIA account can't use ARC.
device_local_profile->GetPrefs()->SetBoolean(prefs::kArcEnabled, true);
auth_service()->OnPrimaryUserProfilePrepared(device_local_profile.get());
- EXPECT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
+ EXPECT_EQ(ArcAuthService::State::NOT_INITIALIZED, auth_service()->state());
// Correctly stop service.
auth_service()->Shutdown();
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.cc ('k') | chrome/browser/chromeos/arc/arc_support_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698