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

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

Issue 10092010: Add CloudPolicyService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. 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
« no previous file with comments | « chrome/browser/policy/cloud_policy_store.cc ('k') | chrome/browser/policy/mock_cloud_policy_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/mock_cloud_policy_client.h
diff --git a/chrome/browser/policy/mock_cloud_policy_client.h b/chrome/browser/policy/mock_cloud_policy_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ebe94f9937cbbf5773070a5214be6d3f48af878
--- /dev/null
+++ b/chrome/browser/policy/mock_cloud_policy_client.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_POLICY_MOCK_CLOUD_POLICY_CLIENT_H_
+#define CHROME_BROWSER_POLICY_MOCK_CLOUD_POLICY_CLIENT_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "chrome/browser/policy/cloud_policy_client.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace policy {
+
+class MockCloudPolicyClient : public CloudPolicyClient {
+ public:
+ MockCloudPolicyClient();
+ virtual ~MockCloudPolicyClient();
+
+ MOCK_METHOD2(SetupRegistration, void(const std::string&, const std::string&));
+ MOCK_METHOD1(Register, void(const std::string&));
+ MOCK_METHOD0(FetchPolicy, void(void));
+ MOCK_METHOD0(Unregister, void(void));
+
+ // Sets the DMToken.
+ void SetDMToken(const std::string& token);
+
+ // Injects policy.
+ void SetPolicy(const enterprise_management::PolicyFetchResponse& policy);
+
+ // Sets the status field.
+ void SetStatus(DeviceManagementStatus status);
+
+ // Make the notification helpers public.
+ using CloudPolicyClient::NotifyPolicyFetched;
+ using CloudPolicyClient::NotifyRegistrationStateChanged;
+ using CloudPolicyClient::NotifyClientError;
+
+ using CloudPolicyClient::submit_machine_id_;
+ using CloudPolicyClient::last_policy_timestamp_;
+ using CloudPolicyClient::public_key_version_;
+ using CloudPolicyClient::public_key_version_valid_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockCloudPolicyClient);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_MOCK_CLOUD_POLICY_CLIENT_H_
« no previous file with comments | « chrome/browser/policy/cloud_policy_store.cc ('k') | chrome/browser/policy/mock_cloud_policy_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698