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

Side by Side Diff: chrome/browser/policy/cloud_policy_manager_unittest.cc

Issue 11361120: Fix bad CloudPolicyManager test harness setup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/policy/cloud_policy_manager.h" 5 #include "chrome/browser/policy/cloud_policy_manager.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 TestHarness::~TestHarness() {} 64 TestHarness::~TestHarness() {}
65 65
66 void TestHarness::SetUp() {} 66 void TestHarness::SetUp() {}
67 67
68 ConfigurationPolicyProvider* TestHarness::CreateProvider( 68 ConfigurationPolicyProvider* TestHarness::CreateProvider(
69 const PolicyDefinitionList* policy_definition_list) { 69 const PolicyDefinitionList* policy_definition_list) {
70 // Create and initialize the store. 70 // Create and initialize the store.
71 store_ = new MockCloudPolicyStore(); 71 store_ = new MockCloudPolicyStore();
72 store_->NotifyStoreLoaded(); 72 store_->NotifyStoreLoaded();
73 EXPECT_CALL(*store_, Load()); 73 EXPECT_CALL(*store_, Load());
74 return new CloudPolicyManager(scoped_ptr<CloudPolicyStore>(store_)); 74 ConfigurationPolicyProvider* provider =
75 new CloudPolicyManager(scoped_ptr<CloudPolicyStore>(store_));
75 Mock::VerifyAndClearExpectations(store_); 76 Mock::VerifyAndClearExpectations(store_);
77 return provider;
76 } 78 }
77 79
78 void TestHarness::InstallEmptyPolicy() {} 80 void TestHarness::InstallEmptyPolicy() {}
79 81
80 void TestHarness::InstallStringPolicy(const std::string& policy_name, 82 void TestHarness::InstallStringPolicy(const std::string& policy_name,
81 const std::string& policy_value) { 83 const std::string& policy_value) {
82 store_->policy_map_.Set(policy_name, policy_level(), policy_scope(), 84 store_->policy_map_.Set(policy_name, policy_level(), policy_scope(),
83 base::Value::CreateStringValue(policy_value)); 85 base::Value::CreateStringValue(policy_value));
84 } 86 }
85 87
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 318
317 // The load notification from |store_| should trigger the policy update. 319 // The load notification from |store_| should trigger the policy update.
318 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get())); 320 EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get()));
319 store_->NotifyStoreLoaded(); 321 store_->NotifyStoreLoaded();
320 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies())); 322 EXPECT_TRUE(expected_bundle_.Equals(manager_->policies()));
321 Mock::VerifyAndClearExpectations(&observer_); 323 Mock::VerifyAndClearExpectations(&observer_);
322 } 324 }
323 325
324 } // namespace 326 } // namespace
325 } // namespace policy 327 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698