Index: chrome/browser/chromeos/arc/arc_session_manager.cc |
diff --git a/chrome/browser/chromeos/arc/arc_session_manager.cc b/chrome/browser/chromeos/arc/arc_session_manager.cc |
index 4858e187b06495dc36b4f14436338ec23116974e..6f191273ad14e5602bc6adf8b5ca7057784e9a65 100644 |
--- a/chrome/browser/chromeos/arc/arc_session_manager.cc |
+++ b/chrome/browser/chromeos/arc/arc_session_manager.cc |
@@ -43,6 +43,7 @@ |
#include "chromeos/dbus/session_manager_client.h" |
#include "components/arc/arc_bridge_service.h" |
#include "components/arc/arc_session_runner.h" |
+#include "components/arc/arc_util.h" |
#include "components/pref_registry/pref_registry_syncable.h" |
#include "components/prefs/pref_service.h" |
#include "components/sync_preferences/pref_service_syncable.h" |
@@ -67,6 +68,9 @@ ash::ShelfDelegate* g_shelf_delegate_for_testing = nullptr; |
// testing. |
bool g_enable_check_android_management_for_testing = false; |
+// Let IsAllowedForProfile() return "false" for any profile. |
+bool g_disallow_for_testing = false; |
hidehiko
2017/01/24 10:57:36
Luis, Yusuke:
this is for testing of info_private_
Luis Héctor Chávez
2017/01/24 17:00:37
I think I prefer having this explicitly rather tha
|
+ |
// Maximum amount of time we'll wait for ARC to finish booting up. Once this |
// timeout expires, keep ARC running in case the user wants to file feedback, |
// but present the UI to try again. |
@@ -148,7 +152,12 @@ void ArcSessionManager::EnableCheckAndroidManagementForTesting() { |
// static |
bool ArcSessionManager::IsAllowedForProfile(const Profile* profile) { |
- if (!ArcBridgeService::GetEnabled(base::CommandLine::ForCurrentProcess())) { |
+ if (g_disallow_for_testing) { |
+ VLOG(1) << "ARC is disallowed for testing."; |
+ return false; |
+ } |
+ |
+ if (!IsArcAvailable()) { |
VLOG(1) << "Arc is not enabled."; |
Luis Héctor Chávez
2017/01/24 17:00:37
nit: not your fault, but can you s/Arc/ARC/?
hidehiko
2017/01/24 18:05:56
Done.
|
return false; |
} |
@@ -199,6 +208,11 @@ bool ArcSessionManager::IsAllowedForProfile(const Profile* profile) { |
} |
// static |
+void ArcSessionManager::DisallowForTesting() { |
+ g_disallow_for_testing = true; |
+} |
+ |
+// static |
bool ArcSessionManager::IsArcKioskMode() { |
return user_manager::UserManager::Get()->IsLoggedInAsArcKioskApp(); |
} |