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

Unified Diff: chrome/browser/policy/asynchronous_policy_test_base.h

Issue 10384145: Removed ConfigurationPolicyProvider::Provide(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased Created 8 years, 7 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/asynchronous_policy_test_base.h
diff --git a/chrome/browser/policy/asynchronous_policy_test_base.h b/chrome/browser/policy/asynchronous_policy_test_base.h
index 887f21da8796541db5a7b3ec8ea43741e45a15b3..1a0a8b399327172e364b337d5b276ade9179a5af 100644
--- a/chrome/browser/policy/asynchronous_policy_test_base.h
+++ b/chrome/browser/policy/asynchronous_policy_test_base.h
@@ -16,7 +16,7 @@
namespace policy {
-class PolicyMap;
+class PolicyBundle;
// A delegate for testing that can feed arbitrary information to the loader.
class ProviderDelegateMock : public AsynchronousPolicyProvider::Delegate {
@@ -24,7 +24,16 @@ class ProviderDelegateMock : public AsynchronousPolicyProvider::Delegate {
ProviderDelegateMock();
virtual ~ProviderDelegateMock();
- MOCK_METHOD0(Load, PolicyMap*());
+ // Load() returns a scoped_ptr<PolicyBundle> but it can't be mocked because
+ // scoped_ptr is moveable but not copyable. This override forwards the
+ // call to MockLoad() which returns a PolicyBundle*, and returns it wrapped
+ // in a passed scoped_ptr.
+ virtual scoped_ptr<PolicyBundle> Load() OVERRIDE {
+ scoped_ptr<PolicyBundle> bundle(MockLoad());
+ return bundle.Pass();
+ }
+
+ MOCK_METHOD0(MockLoad, PolicyBundle*());
private:
DISALLOW_COPY_AND_ASSIGN(ProviderDelegateMock);

Powered by Google App Engine
This is Rietveld 408576698