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

Unified Diff: chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc

Issue 822523003: Implement device-local account policy pushing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_442800_switch_device_cloud_policy_invalidator
Patch Set: Removed the need to initialize singletons in unit tests. Created 5 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
Index: chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
diff --git a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
index d076ae9badeac88f8ee1c9b3845f6f633cc06b95..997c1cd0398a3ece2cf08d27668f3c1eb55b2037 100644
--- a/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
+++ b/chrome/browser/chromeos/policy/cloud_external_data_policy_observer_unittest.cc
@@ -17,6 +17,7 @@
#include "base/run_loop.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provider.h"
#include "chrome/browser/chromeos/policy/cloud_external_data_manager_base_test_util.h"
#include "chrome/browser/chromeos/policy/device_local_account.h"
#include "chrome/browser/chromeos/policy/device_local_account_external_data_manager.h"
@@ -140,6 +141,8 @@ class CloudExternalDataPolicyObserverTest
chromeos::CrosSettings cros_settings_;
scoped_ptr<DeviceLocalAccountPolicyService>
device_local_account_policy_service_;
+ scoped_ptr<AffiliatedInvalidationServiceProvider>
+ affiliated_invalidation_service_provider_;
net::TestURLFetcherFactory url_fetcher_factory_;
scoped_ptr<DeviceLocalAccountPolicyProvider>
@@ -177,16 +180,28 @@ CloudExternalDataPolicyObserverTest::~CloudExternalDataPolicyObserverTest() {
void CloudExternalDataPolicyObserverTest::SetUp() {
chromeos::DeviceSettingsTestBase::SetUp();
+
ASSERT_TRUE(profile_manager_.SetUp());
+
+ affiliated_invalidation_service_provider_.reset(
+ new AffiliatedInvalidationServiceProvider);
+ // Mark the |affiliated_invalidation_service_provider_| as shut down
+ // immediately. This will prevent it from trying to find an available
+ // invalidation service, which pulls in a lot of additional run-time
+ // dependencies.
+ affiliated_invalidation_service_provider_->Shutdown();
+
device_local_account_policy_service_.reset(
- new DeviceLocalAccountPolicyService(&device_settings_test_helper_,
- &device_settings_service_,
- &cros_settings_,
- base::MessageLoopProxy::current(),
- base::MessageLoopProxy::current(),
- base::MessageLoopProxy::current(),
- base::MessageLoopProxy::current(),
- NULL));
+ new DeviceLocalAccountPolicyService(
+ &device_settings_test_helper_,
+ &device_settings_service_,
+ &cros_settings_,
+ affiliated_invalidation_service_provider_.get(),
+ base::MessageLoopProxy::current(),
+ base::MessageLoopProxy::current(),
+ base::MessageLoopProxy::current(),
+ base::MessageLoopProxy::current(),
+ NULL));
pneubeck (no reviews) 2015/01/30 14:23:58 nit: nullptr
bartfab (slow) 2015/02/03 18:31:05 Done.
url_fetcher_factory_.set_remove_fetcher_on_delete(true);
EXPECT_CALL(user_policy_provider_, IsInitializationComplete(_))

Powered by Google App Engine
This is Rietveld 408576698