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

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

Issue 2655873002: Get enrollment token from DMServer when an Active Directory user uses ARC (Closed)
Patch Set: Fix Luis's comments Created 3 years, 10 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
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..1fe41ed8dc534102c66109d36582f22a79f7153a 100644
--- a/chrome/browser/chromeos/arc/arc_util_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_util_unittest.cc
@@ -38,7 +38,8 @@ class ScopedLogIn {
user_manager::UserType user_type = user_manager::USER_TYPE_REGULAR)
: fake_user_manager_(fake_user_manager), account_id_(account_id) {
switch (user_type) {
- case user_manager::USER_TYPE_REGULAR:
+ case user_manager::USER_TYPE_REGULAR: // fallthrough
+ 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(
+ {"", "--arc-availability=officially-supported-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()),

Powered by Google App Engine
This is Rietveld 408576698