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

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

Issue 2485233002: Do not run Android management check for re-auth case. (Closed)
Patch Set: Created 4 years, 1 month 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
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 414f6c21578ccc9dd8b027ab1b97e1262fb73ceb..1c4f73a2f3f897a09062f657cdaf0a7293454e75 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
@@ -132,7 +132,7 @@ TEST_F(ArcAuthServiceTest, PrefChangeTriggersService) {
ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
pref->SetBoolean(prefs::kArcEnabled, true);
- ASSERT_EQ(ArcAuthService::State::FETCHING_CODE, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::TERMS, auth_service()->state());
pref->SetBoolean(prefs::kArcEnabled, false);
ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
@@ -195,8 +195,11 @@ TEST_F(ArcAuthServiceTest, BaseWorkflow) {
profile()->GetPrefs()->SetBoolean(prefs::kArcEnabled, true);
// Setting profile and pref initiates a code fetching process.
- ASSERT_EQ(ArcAuthService::State::FETCHING_CODE, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::TERMS, auth_service()->state());
+ // TODO(hidehiko): Verify state transition from TERMS ->
+ // ANDROID_MANAGEMENT_CHECK -> FETCHING_CODE, when we extract
+ // ArcSessionManager.
auth_service()->SetAuthCodeAndStartArc(kTestAuthCode);
ASSERT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state());
@@ -214,13 +217,13 @@ TEST_F(ArcAuthServiceTest, BaseWorkflow) {
auth_service()->OnPrimaryUserProfilePrepared(profile());
// Setting profile initiates a code fetching process.
- ASSERT_EQ(ArcAuthService::State::FETCHING_CODE, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::TERMS, auth_service()->state());
content::BrowserThread::GetBlockingPool()->FlushForTesting();
base::RunLoop().RunUntilIdle();
// UI is disabled in unit tests and this code is unchanged.
- ASSERT_EQ(ArcAuthService::State::FETCHING_CODE, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::TERMS, auth_service()->state());
// Correctly stop service.
auth_service()->Shutdown();
@@ -231,7 +234,7 @@ TEST_F(ArcAuthServiceTest, CancelFetchingDisablesArc) {
auth_service()->OnPrimaryUserProfilePrepared(profile());
pref->SetBoolean(prefs::kArcEnabled, true);
- ASSERT_EQ(ArcAuthService::State::FETCHING_CODE, auth_service()->state());
+ ASSERT_EQ(ArcAuthService::State::TERMS, auth_service()->state());
auth_service()->CancelAuthCode();
ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
@@ -280,7 +283,7 @@ TEST_F(ArcAuthServiceTest, SignInStatus) {
prefs->SetBoolean(prefs::kArcEnabled, true);
auth_service()->OnPrimaryUserProfilePrepared(profile());
- EXPECT_EQ(ArcAuthService::State::FETCHING_CODE, auth_service()->state());
+ EXPECT_EQ(ArcAuthService::State::TERMS, auth_service()->state());
auth_service()->SetAuthCodeAndStartArc(kTestAuthCode);
EXPECT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state());
EXPECT_TRUE(bridge_service()->ready());

Powered by Google App Engine
This is Rietveld 408576698