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

Unified Diff: components/arc/arc_util_unittest.cc

Issue 2671463002: Support new --arc-availability flag. (Closed)
Patch Set: rebase 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
« no previous file with comments | « components/arc/arc_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c7ad19fc971c96fcabf411927ad69d6aae74d8da 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,13 +85,32 @@ 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) {
+TEST_F(ArcUtilTest, IsArcAvailable_OfficiallySupported) {
// Regardless of FeatureList, IsArcAvailable() should return true.
auto* command_line = base::CommandLine::ForCurrentProcess();
command_line->InitFromArgv({"", "--enable-arc"});
EXPECT_TRUE(IsArcAvailable());
+
+ command_line->InitFromArgv({"", "--arc-availability=officially-supported"});
+ EXPECT_TRUE(IsArcAvailable());
}
// TODO(hidehiko): Add test for IsArcKioskMode().
« no previous file with comments | « components/arc/arc_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698