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

Unified Diff: components/policy/core/common/cloud/cloud_policy_service_unittest.cc

Issue 762863002: Removed policy::PolicyNamespaceKey. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: components/policy/core/common/cloud/cloud_policy_service_unittest.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_service_unittest.cc b/components/policy/core/common/cloud/cloud_policy_service_unittest.cc
index 005316618670f73ff4655c600a5ec9b975619b42..42b0b56d1abc93e281beefbc383133d4815a5786 100644
--- a/components/policy/core/common/cloud/cloud_policy_service_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_service_unittest.cc
@@ -32,13 +32,13 @@ class MockCloudPolicyServiceObserver : public CloudPolicyService::Observer {
class CloudPolicyServiceTest : public testing::Test {
public:
CloudPolicyServiceTest()
- : policy_ns_key_(dm_protocol::kChromeUserPolicyType, std::string()),
- service_(policy_ns_key_, &client_, &store_) {}
+ : policy_type_(dm_protocol::kChromeUserPolicyType),
+ service_(policy_type_, "", &client_, &store_) {}
MOCK_METHOD1(OnPolicyRefresh, void(bool));
protected:
- PolicyNamespaceKey policy_ns_key_;
+ std::string policy_type_;
MockCloudPolicyClient client_;
MockCloudPolicyStore store_;
CloudPolicyService service_;
@@ -61,7 +61,7 @@ TEST_F(CloudPolicyServiceTest, ManagedByValidPolicy) {
TEST_F(CloudPolicyServiceTest, PolicyUpdateSuccess) {
em::PolicyFetchResponse policy;
policy.set_policy_data("fake policy");
- client_.SetPolicy(policy_ns_key_, policy);
+ client_.SetPolicy(policy_type_, "", policy);
EXPECT_CALL(store_, Store(ProtoMatches(policy))).Times(1);
client_.NotifyPolicyFetched();
@@ -104,7 +104,7 @@ TEST_F(CloudPolicyServiceTest, RefreshPolicySuccess) {
// Client responds, push policy to store.
em::PolicyFetchResponse policy;
policy.set_policy_data("fake policy");
- client_.SetPolicy(policy_ns_key_, policy);
+ client_.SetPolicy(policy_type_, "", policy);
client_.fetched_invalidation_version_ = 12345;
EXPECT_CALL(store_, Store(ProtoMatches(policy))).Times(1);
EXPECT_EQ(0, store_.invalidation_version());
@@ -160,7 +160,7 @@ TEST_F(CloudPolicyServiceTest, RefreshPolicyStoreError) {
// Client responds, push policy to store.
em::PolicyFetchResponse policy;
policy.set_policy_data("fake policy");
- client_.SetPolicy(policy_ns_key_, policy);
+ client_.SetPolicy(policy_type_, "", policy);
EXPECT_CALL(store_, Store(ProtoMatches(policy))).Times(1);
client_.NotifyPolicyFetched();
@@ -188,7 +188,7 @@ TEST_F(CloudPolicyServiceTest, RefreshPolicyConcurrent) {
// Client responds, push policy to store.
em::PolicyFetchResponse policy;
policy.set_policy_data("fake policy");
- client_.SetPolicy(policy_ns_key_, policy);
+ client_.SetPolicy(policy_type_, "", policy);
EXPECT_CALL(store_, Store(ProtoMatches(policy))).Times(1);
client_.NotifyPolicyFetched();
@@ -214,7 +214,7 @@ TEST_F(CloudPolicyServiceTest, StoreAlreadyInitialized) {
// Service should start off initialized if the store has already loaded
// policy.
store_.NotifyStoreLoaded();
- CloudPolicyService service(policy_ns_key_, &client_, &store_);
+ CloudPolicyService service(policy_type_, "", &client_, &store_);
EXPECT_TRUE(service.IsInitializationComplete());
}

Powered by Google App Engine
This is Rietveld 408576698