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

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: rebase 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
« 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 414f6c21578ccc9dd8b027ab1b97e1262fb73ceb..a956c616770780aa8840aa4bc340d08e1e494c80 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service_unittest.cc
@@ -132,7 +132,8 @@ 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::SHOWING_TERMS_OF_SERVICE,
+ auth_service()->state());
pref->SetBoolean(prefs::kArcEnabled, false);
ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
@@ -195,8 +196,12 @@ 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::SHOWING_TERMS_OF_SERVICE,
+ auth_service()->state());
+ // TODO(hidehiko): Verify state transition from SHOWINING_TERMS_OF_SERVICE ->
+ // CHECKING_ANDROID_MANAGEMENT -> FETCHING_CODE, when we extract
+ // ArcSessionManager.
auth_service()->SetAuthCodeAndStartArc(kTestAuthCode);
ASSERT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state());
@@ -214,13 +219,15 @@ 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::SHOWING_TERMS_OF_SERVICE,
+ 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::SHOWING_TERMS_OF_SERVICE,
+ auth_service()->state());
// Correctly stop service.
auth_service()->Shutdown();
@@ -231,7 +238,8 @@ 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::SHOWING_TERMS_OF_SERVICE,
+ auth_service()->state());
auth_service()->CancelAuthCode();
ASSERT_EQ(ArcAuthService::State::STOPPED, auth_service()->state());
@@ -280,7 +288,8 @@ 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::SHOWING_TERMS_OF_SERVICE,
+ auth_service()->state());
auth_service()->SetAuthCodeAndStartArc(kTestAuthCode);
EXPECT_EQ(ArcAuthService::State::ACTIVE, auth_service()->state());
EXPECT_TRUE(bridge_service()->ready());
« 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