| Index: components/arc/arc_util_unittest.cc
|
| diff --git a/components/arc/arc_util_unittest.cc b/components/arc/arc_util_unittest.cc
|
| index ff3f6113ea3934aec56167e133f45aba62c499d0..7463a583289ecdcc5ce5f988e72b6d32638e2b40 100644
|
| --- a/components/arc/arc_util_unittest.cc
|
| +++ b/components/arc/arc_util_unittest.cc
|
| @@ -36,6 +36,20 @@ class ScopedArcFeature {
|
|
|
| using ArcUtilTest = testing::Test;
|
|
|
| +TEST_F(ArcUtilTest, IsArcAvailable_None) {
|
| + auto* command_line = base::CommandLine::ForCurrentProcess();
|
| +
|
| + command_line->InitFromArgv({"", "--arc-availability=none"});
|
| + EXPECT_FALSE(IsArcAvailable());
|
| +
|
| + // If --arc-availability flag is set to "none", even if Finch experiment is
|
| + // turned on, ARC cannot be used.
|
| + {
|
| + ScopedArcFeature feature(true);
|
| + EXPECT_FALSE(IsArcAvailable());
|
| + }
|
| +}
|
| +
|
| // Test --arc-available with EnableARC feature combination.
|
| TEST_F(ArcUtilTest, IsArcAvailable_Installed) {
|
| auto* command_line = base::CommandLine::ForCurrentProcess();
|
| @@ -71,6 +85,22 @@ TEST_F(ArcUtilTest, IsArcAvailable_Installed) {
|
| ScopedArcFeature feature(false);
|
| EXPECT_FALSE(IsArcAvailable());
|
| }
|
| +
|
| + // If ARC is installed, IsArcAvailable() should return true when EnableARC
|
| + // feature is set.
|
| + command_line->InitFromArgv({"", "--arc-availability=installed"});
|
| +
|
| + // Not available, by-default, too.
|
| + EXPECT_FALSE(IsArcAvailable());
|
| +
|
| + {
|
| + ScopedArcFeature feature(true);
|
| + EXPECT_TRUE(IsArcAvailable());
|
| + }
|
| + {
|
| + ScopedArcFeature feature(false);
|
| + EXPECT_FALSE(IsArcAvailable());
|
| + }
|
| }
|
|
|
| TEST_F(ArcUtilTest, IsArcAvailable_OfficialSupport) {
|
| @@ -78,6 +108,9 @@ TEST_F(ArcUtilTest, IsArcAvailable_OfficialSupport) {
|
| auto* command_line = base::CommandLine::ForCurrentProcess();
|
| command_line->InitFromArgv({"", "--enable-arc"});
|
| EXPECT_TRUE(IsArcAvailable());
|
| +
|
| + command_line->InitFromArgv({"", "--arc-availability=official-support"});
|
| + EXPECT_TRUE(IsArcAvailable());
|
| }
|
|
|
| // TODO(hidehiko): Add test for IsArcKioskMode().
|
|
|