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

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

Issue 8586030: Added ConfigurationPolicyProvider::RefreshPolicies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: BrowserPolicyConnector is less static; addressed comments Created 9 years, 1 month 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_provider_unittest.cc
diff --git a/chrome/browser/policy/cloud_policy_provider_unittest.cc b/chrome/browser/policy/cloud_policy_provider_unittest.cc
index 1af50371ae893c5430b038b9a6e8f9a7761bef5d..c44b77b4b6c4789e9a6b3ea40449a9c3c73708fe 100644
--- a/chrome/browser/policy/cloud_policy_provider_unittest.cc
+++ b/chrome/browser/policy/cloud_policy_provider_unittest.cc
@@ -6,6 +6,8 @@
#include "base/basictypes.h"
#include "base/values.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/policy/browser_policy_connector.h"
#include "chrome/browser/policy/cloud_policy_cache_base.h"
#include "chrome/browser/policy/cloud_policy_provider_impl.h"
#include "chrome/browser/policy/configuration_policy_pref_store.h"
@@ -47,10 +49,6 @@ class MockCloudPolicyCache : public CloudPolicyCacheBase {
is_unmanaged_ = true;
}
- void SetFetchingDone() {
- // Implement pure virtual method.
- }
-
void set_initialized(bool initialized) {
initialization_complete_ = initialized;
}
@@ -61,9 +59,16 @@ class MockCloudPolicyCache : public CloudPolicyCacheBase {
class CloudPolicyProviderTest : public testing::Test {
protected:
+ virtual void SetUp() OVERRIDE {
+ browser_policy_connector_.reset(new BrowserPolicyConnector());
Mattias Nissler (ping if slow) 2011/11/18 16:14:11 No need to wrap in a scoped_ptr.
Joao da Silva 2011/11/21 14:55:04 Done.
+ }
+
void CreateCloudPolicyProvider(CloudPolicyCacheBase::PolicyLevel level) {
- cloud_policy_provider_.reset(new CloudPolicyProviderImpl(
- GetChromePolicyDefinitionList(), level));
+ cloud_policy_provider_.reset(
+ new CloudPolicyProviderImpl(
+ browser_policy_connector_.get(),
+ GetChromePolicyDefinitionList(),
+ level));
}
// Appends the caches to a provider and then provides the policies to
@@ -71,6 +76,7 @@ class CloudPolicyProviderTest : public testing::Test {
void RunCachesThroughProvider(MockCloudPolicyCache caches[], int n,
CloudPolicyCacheBase::PolicyLevel level) {
CloudPolicyProviderImpl provider(
+ g_browser_process->browser_policy_connector(),
GetChromePolicyDefinitionList(),
level);
for (int i = 0; i < n; i++) {
@@ -111,11 +117,7 @@ class CloudPolicyProviderTest : public testing::Test {
}
private:
- // Some tests need a list of policies that doesn't contain any proxy
- // policies. Note: these policies will be handled as if they had the
- // type of Value::TYPE_INTEGER.
- static const ConfigurationPolicyType simple_policies[];
-
+ scoped_ptr<BrowserPolicyConnector> browser_policy_connector_;
scoped_ptr<CloudPolicyProviderImpl> cloud_policy_provider_;
scoped_ptr<PolicyMap> policy_map_;
};
« no previous file with comments | « chrome/browser/policy/cloud_policy_provider_impl.cc ('k') | chrome/browser/policy/configuration_policy_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698