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

Side by Side Diff: chrome/browser/chromeos/arc/arc_util_unittest.cc

Issue 2926893002: arc: Start ARC for Public Session users.
Patch Set: Hide Play Store Created 3 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/arc/arc_util.h" 5 #include "chrome/browser/chromeos/arc/arc_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 EXPECT_FALSE(IsArcAllowedForProfile(profile())); 231 EXPECT_FALSE(IsArcAllowedForProfile(profile()));
232 } 232 }
233 233
234 // User without GAIA account. 234 // User without GAIA account.
235 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_PublicAccount) { 235 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_PublicAccount) {
236 base::CommandLine::ForCurrentProcess()->InitFromArgv( 236 base::CommandLine::ForCurrentProcess()->InitFromArgv(
237 {"", "--arc-availability=officially-supported"}); 237 {"", "--arc-availability=officially-supported"});
238 ScopedLogIn login(GetFakeUserManager(), 238 ScopedLogIn login(GetFakeUserManager(),
239 AccountId::FromUserEmail("public_user@gmail.com"), 239 AccountId::FromUserEmail("public_user@gmail.com"),
240 user_manager::USER_TYPE_PUBLIC_ACCOUNT); 240 user_manager::USER_TYPE_PUBLIC_ACCOUNT);
241 EXPECT_FALSE(IsArcAllowedForProfile(profile())); 241 EXPECT_FALSE(chromeos::ProfileHelper::Get()
242 ->GetUserByProfile(profile())
243 ->HasGaiaAccount());
244 EXPECT_TRUE(IsArcAllowedForProfile(profile()));
242 } 245 }
243 246
244 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_ActiveDirectoryEnabled) { 247 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_ActiveDirectoryEnabled) {
245 base::CommandLine::ForCurrentProcess()->InitFromArgv( 248 base::CommandLine::ForCurrentProcess()->InitFromArgv(
246 {"", "--arc-availability=officially-supported"}); 249 {"", "--arc-availability=officially-supported"});
247 ScopedLogIn login( 250 ScopedLogIn login(
248 GetFakeUserManager(), 251 GetFakeUserManager(),
249 AccountId::AdFromObjGuid("f04557de-5da2-40ce-ae9d-b8874d8da96e"), 252 AccountId::AdFromObjGuid("f04557de-5da2-40ce-ae9d-b8874d8da96e"),
250 user_manager::USER_TYPE_ACTIVE_DIRECTORY); 253 user_manager::USER_TYPE_ACTIVE_DIRECTORY);
251 EXPECT_FALSE(chromeos::ProfileHelper::Get() 254 EXPECT_FALSE(chromeos::ProfileHelper::Get()
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 EXPECT_FALSE(IsArcAllowedForProfile(profile())); 315 EXPECT_FALSE(IsArcAllowedForProfile(profile()));
313 GetFakeUserManager()->ResetUserFlow(manager_id); 316 GetFakeUserManager()->ResetUserFlow(manager_id);
314 } 317 }
315 318
316 // Guest account is interpreted as EphemeralDataUser. 319 // Guest account is interpreted as EphemeralDataUser.
317 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_GuestAccount) { 320 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_GuestAccount) {
318 base::CommandLine::ForCurrentProcess()->InitFromArgv( 321 base::CommandLine::ForCurrentProcess()->InitFromArgv(
319 {"", "--arc-availability=officially-supported"}); 322 {"", "--arc-availability=officially-supported"});
320 ScopedLogIn login(GetFakeUserManager(), 323 ScopedLogIn login(GetFakeUserManager(),
321 GetFakeUserManager()->GetGuestAccountId()); 324 GetFakeUserManager()->GetGuestAccountId());
322 EXPECT_FALSE(IsArcAllowedForProfile(profile())); 325 EXPECT_TRUE(IsArcAllowedForProfile(profile()));
323 } 326 }
324 327
325 // Demo account is interpreted as EphemeralDataUser. 328 // Demo account is interpreted as EphemeralDataUser.
326 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_DemoAccount) { 329 TEST_F(ChromeArcUtilTest, IsArcAllowedForProfile_DemoAccount) {
327 base::CommandLine::ForCurrentProcess()->InitFromArgv( 330 base::CommandLine::ForCurrentProcess()->InitFromArgv(
328 {"", "--arc-availability=officially-supported"}); 331 {"", "--arc-availability=officially-supported"});
329 ScopedLogIn login(GetFakeUserManager(), user_manager::DemoAccountId()); 332 ScopedLogIn login(GetFakeUserManager(), user_manager::DemoAccountId());
330 EXPECT_FALSE(IsArcAllowedForProfile(profile())); 333 EXPECT_TRUE(IsArcAllowedForProfile(profile()));
331 } 334 }
332 335
333 TEST_F(ChromeArcUtilTest, IsArcCompatibleFileSystemUsedForProfile) { 336 TEST_F(ChromeArcUtilTest, IsArcCompatibleFileSystemUsedForProfile) {
334 base::CommandLine::ForCurrentProcess()->InitFromArgv( 337 base::CommandLine::ForCurrentProcess()->InitFromArgv(
335 {"", "--arc-availability=officially-supported"}); 338 {"", "--arc-availability=officially-supported"});
336 339
337 const AccountId id(AccountId::FromUserEmailGaiaId( 340 const AccountId id(AccountId::FromUserEmailGaiaId(
338 profile()->GetProfileUserName(), kTestGaiaId)); 341 profile()->GetProfileUserName(), kTestGaiaId));
339 ScopedLogIn login(GetFakeUserManager(), id); 342 ScopedLogIn login(GetFakeUserManager(), id);
340 343
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 false /* expect_migration_allowed */}, 661 false /* expect_migration_allowed */},
659 AskForEcryptfsArcUserTestParam{false /* device_supported_arc */, 662 AskForEcryptfsArcUserTestParam{false /* device_supported_arc */,
660 true /* arc_enabled */, 663 true /* arc_enabled */,
661 false /* expect_migration_allowed */}, 664 false /* expect_migration_allowed */},
662 AskForEcryptfsArcUserTestParam{false /* device_supported_arc */, 665 AskForEcryptfsArcUserTestParam{false /* device_supported_arc */,
663 false /* arc_enabled */, 666 false /* arc_enabled */,
664 false /* expect_migration_allowed */})); 667 false /* expect_migration_allowed */}));
665 668
666 } // namespace util 669 } // namespace util
667 } // namespace arc 670 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698