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

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

Issue 6979011: Move user cloud policy to BrowserProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handling alternative login-path on CrOS differently. Rebase. Created 9 years, 6 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/cloud_policy_controller_unittest.cc
diff --git a/chrome/browser/policy/cloud_policy_controller_unittest.cc b/chrome/browser/policy/cloud_policy_controller_unittest.cc
index df2ae58254b063b67b39de2234a7d6c3680a890e..e6f8d1bd5e0daad3d96e14057e00a86e4ad7d1ef 100644
--- a/chrome/browser/policy/cloud_policy_controller_unittest.cc
+++ b/chrome/browser/policy/cloud_policy_controller_unittest.cc
@@ -6,6 +6,8 @@
#include "base/message_loop.h"
#include "base/scoped_temp_dir.h"
+#include "chrome/browser/policy/cloud_policy_provider.h"
+#include "chrome/browser/policy/configuration_policy_pref_store.h"
#include "chrome/browser/policy/device_management_service.h"
#include "chrome/browser/policy/device_token_fetcher.h"
#include "chrome/browser/policy/mock_configuration_policy_store.h"
@@ -85,6 +87,14 @@ class CloudPolicyControllerTest : public testing::Test {
ASSERT_TRUE(temp_user_data_dir_.CreateUniqueTempDir());
cache_.reset(new UserPolicyCache(
temp_user_data_dir_.path().AppendASCII("CloudPolicyControllerTest")));
+ mandatory_cloud_provider_.reset(new CloudPolicyProvider(
+ policy::ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(),
+ CloudPolicyCacheBase::POLICY_LEVEL_MANDATORY));
+ recommended_cloud_provider_.reset(new CloudPolicyProvider(
+ policy::ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(),
+ CloudPolicyCacheBase::POLICY_LEVEL_RECOMMENDED));
+ mandatory_cloud_provider_->AppendCache(cache_.get());
+ recommended_cloud_provider_->AppendCache(cache_.get());
token_fetcher_.reset(new MockDeviceTokenFetcher(cache_.get()));
service_.set_backend(&backend_);
}
@@ -116,7 +126,7 @@ class CloudPolicyControllerTest : public testing::Test {
void ExpectHasSpdyPolicy() {
MockConfigurationPolicyStore store;
EXPECT_CALL(store, Apply(_, _)).Times(AtLeast(1));
- cache_->GetManagedPolicyProvider()->Provide(&store);
+ mandatory_cloud_provider_.get()->Provide(&store);
Mattias Nissler (ping if slow) 2011/06/09 14:36:26 Why can't we just check the policy map directly no
sfeuz 2011/06/13 06:53:53 Done.
FundamentalValue expected(true);
ASSERT_TRUE(store.Get(kPolicyDisableSpdy) != NULL);
EXPECT_TRUE(store.Get(kPolicyDisableSpdy)->Equals(&expected));
@@ -151,6 +161,8 @@ class CloudPolicyControllerTest : public testing::Test {
protected:
scoped_ptr<CloudPolicyCacheBase> cache_;
+ scoped_ptr<CloudPolicyProvider> recommended_cloud_provider_;
+ scoped_ptr<CloudPolicyProvider> mandatory_cloud_provider_;
scoped_ptr<CloudPolicyController> controller_;
scoped_ptr<MockDeviceTokenFetcher> token_fetcher_;
MockCloudPolicyIdentityStrategy identity_strategy_;

Powered by Google App Engine
This is Rietveld 408576698