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

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

Issue 2711033002: Fix Arc integration test. (Closed)
Patch Set: Address hidehiko'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.cc
diff --git a/chrome/browser/chromeos/arc/arc_util.cc b/chrome/browser/chromeos/arc/arc_util.cc
index 49b6f04bdf062d1d444ff68f48c80ec53804ce3b..180112a61546f5ca4335e98955cdc2ebb2a47f6a 100644
--- a/chrome/browser/chromeos/arc/arc_util.cc
+++ b/chrome/browser/chromeos/arc/arc_util.cc
@@ -18,16 +18,19 @@
namespace arc {
namespace {
lgcheng 2017/02/25 01:40:38 Comments for type are in util.h.
-
-// Let IsAllowedForProfile() return "false" for any profile.
-bool g_disallow_for_testing = false;
-
+ArcAllowedForTestType g_arc_allowed_for_test_type = NOTSET;
} // namespace
bool IsArcAllowedForProfile(const Profile* profile) {
- if (g_disallow_for_testing) {
- VLOG(1) << "ARC is disallowed for testing.";
- return false;
+ switch (g_arc_allowed_for_test_type) {
+ case ALLOWEDFORSYNCTEST:
+ return true;
+ case DISALLOWEDFORTEST:
+ return false;
+ // Goes through regular checks.
+ case NOTSET:
+ default:
hidehiko 2017/03/02 17:45:39 No default section please. cf) arc++chromium-style
lgcheng 2017/03/02 23:45:10 Modification for this file is abandoned.
+ break;
}
// ARC Kiosk can be enabled even if ARC is not yet supported on the device.
@@ -94,8 +97,8 @@ bool IsArcAllowedForProfile(const Profile* profile) {
return true;
}
-void DisallowArcForTesting() {
- g_disallow_for_testing = true;
+void SetArcAllowedForTesting(ArcAllowedForTestType type) {
+ g_arc_allowed_for_test_type = type;
}
bool IsArcPlayStoreEnabledForProfile(const Profile* profile) {

Powered by Google App Engine
This is Rietveld 408576698