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

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

Issue 2149853004: arc: Implement safe access to ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update arc unit tests expectations for not-allowed profiles. 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 352899f93386ebaac4a92e3c77db903662c80cbb..e0f17691e6e41ddfeca00647153b55d15fe919ed 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
@@ -147,13 +147,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"));
@@ -161,16 +161,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();
@@ -327,7 +328,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