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

Unified Diff: chrome/browser/policy/browser_policy_connector.cc

Issue 10827216: Don't run BrowserPolicyConnector::Init from TestingBrowserProcess by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 4 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/policy/browser_policy_connector.cc
diff --git a/chrome/browser/policy/browser_policy_connector.cc b/chrome/browser/policy/browser_policy_connector.cc
index 552de44eb74d1a5fe0d766259fdaf9a6be25e22a..1d39ea67cb1922b5fe66a8eb7d56353d7798c73f 100644
--- a/chrome/browser/policy/browser_policy_connector.cc
+++ b/chrome/browser/policy/browser_policy_connector.cc
@@ -128,10 +128,7 @@ BrowserPolicyConnector::~BrowserPolicyConnector() {
void BrowserPolicyConnector::Init() {
DCHECK(!device_management_service_.get()) <<
"BrowserPolicyConnector::Init() called twice.";
- // Don't create platform providers if running in a unit test, since
- // AsyncPlatformLoader requires deletion on the FILE thread.
- if (MessageLoop::current())
- platform_provider_.reset(CreatePlatformProvider());
+ platform_provider_.reset(CreatePlatformProvider());
device_management_service_.reset(
new DeviceManagementService(GetDeviceManagementUrl()));
@@ -149,10 +146,6 @@ void BrowserPolicyConnector::Init() {
InitializeDevicePolicy();
- // Don't bother updating the cache if this is a unit test.
- if (!MessageLoop::current())
- return;
-
// Create the AppPackUpdater to start updating the cache. It requires the
// system request context, which isn't available yet; therefore it is
// created only once the loops are running.
@@ -546,10 +539,6 @@ void BrowserPolicyConnector::InitializeDevicePolicy() {
device_policy_cache,
GetDeviceManagementUrl()));
- // Skip the final initialization if this is a unit test.
- if (!MessageLoop::current())
- return;
-
// Initialize the subsystem once the message loops are spinning.
MessageLoop::current()->PostTask(
FROM_HERE,
« no previous file with comments | « chrome/browser/chromeos/login/login_utils_browsertest.cc ('k') | chrome/browser/policy/config_dir_policy_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698