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

Unified Diff: components/arc/arc_util_unittest.cc

Issue 2671463002: Support new --arc-availability flag. (Closed)
Patch Set: Created 3 years, 11 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
« chromeos/chromeos_switches.cc ('K') | « 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..3a89362ac20dd4ae35b5d4919869928fcb41e291 100644
--- a/components/arc/arc_util_unittest.cc
+++ b/components/arc/arc_util_unittest.cc
@@ -71,6 +71,22 @@ TEST_F(ArcUtilTest, IsArcAvailable_Installed) {
ScopedArcFeature feature(false);
EXPECT_FALSE(IsArcAvailable());
}
+
Yusuke Sato 2017/02/02 18:14:06 can you test "none"?
hidehiko 2017/02/03 15:37:42 Done.
+ // 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 +94,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().
« chromeos/chromeos_switches.cc ('K') | « components/arc/arc_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698