Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_util_unittest.cc |
| diff --git a/chrome/browser/chromeos/arc/arc_util_unittest.cc b/chrome/browser/chromeos/arc/arc_util_unittest.cc |
| index 7f6d8bc0f19a8ed6f84626184d1ac814ef647683..16e36651d7dc691870ffb11bd05e0bba6b0cd33f 100644 |
| --- a/chrome/browser/chromeos/arc/arc_util_unittest.cc |
| +++ b/chrome/browser/chromeos/arc/arc_util_unittest.cc |
| @@ -39,6 +39,7 @@ class ScopedLogIn { |
| : fake_user_manager_(fake_user_manager), account_id_(account_id) { |
| switch (user_type) { |
| case user_manager::USER_TYPE_REGULAR: |
|
Luis Héctor Chávez
2017/02/06 22:00:15
nit: // fallthrough
Marton Hunyady
2017/02/07 14:53:42
Done.
|
| + case user_manager::USER_TYPE_ACTIVE_DIRECTORY: |
| LogIn(); |
| break; |
| case user_manager::USER_TYPE_ARC_KIOSK_APP: |
| @@ -154,6 +155,30 @@ TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_NonPrimaryProfile) { |
| EXPECT_FALSE(IsArcAllowedForProfile(profile())); |
| } |
| +TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_ActiveDirectoryEnabled) { |
| + base::CommandLine::ForCurrentProcess()->InitFromArgv( |
| + {"", "--enable-arc", "--enable-android-with-active-directory"}); |
| + ScopedLogIn login( |
| + GetFakeUserManager(), |
| + AccountId::AdFromObjGuid("f04557de-5da2-40ce-ae9d-b8874d8da96e"), |
| + user_manager::USER_TYPE_ACTIVE_DIRECTORY); |
| + EXPECT_FALSE(chromeos::ProfileHelper::Get() |
| + ->GetUserByProfile(profile()) |
| + ->HasGaiaAccount()); |
| + EXPECT_TRUE(IsArcAllowedForProfile(profile())); |
| +} |
| + |
| +TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_ActiveDirectoryDisabled) { |
| + ScopedLogIn login( |
| + GetFakeUserManager(), |
| + AccountId::AdFromObjGuid("f04557de-5da2-40ce-ae9d-b8874d8da96e"), |
| + user_manager::USER_TYPE_ACTIVE_DIRECTORY); |
| + EXPECT_FALSE(chromeos::ProfileHelper::Get() |
| + ->GetUserByProfile(profile()) |
| + ->HasGaiaAccount()); |
| + EXPECT_FALSE(IsArcAllowedForProfile(profile())); |
| +} |
| + |
| TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_Kiosk) { |
| ScopedLogIn login(GetFakeUserManager(), |
| AccountId::FromUserEmail(profile()->GetProfileUserName()), |