OLD | NEW |
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 #ifndef CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_ |
6 #define CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_ | 6 #define CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chrome/browser/policy/cloud/cloud_policy_client.h" | 11 #include "chrome/browser/policy/cloud/cloud_policy_client.h" |
12 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" | 12 #include "chrome/browser/policy/cloud/cloud_policy_constants.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
14 | 14 |
15 namespace policy { | 15 namespace policy { |
16 | 16 |
17 class MockCloudPolicyClient : public CloudPolicyClient { | 17 class MockCloudPolicyClient : public CloudPolicyClient { |
18 public: | 18 public: |
19 MockCloudPolicyClient(); | 19 MockCloudPolicyClient(); |
20 virtual ~MockCloudPolicyClient(); | 20 virtual ~MockCloudPolicyClient(); |
21 | 21 |
22 MOCK_METHOD2(SetupRegistration, void(const std::string&, const std::string&)); | 22 MOCK_METHOD2(SetupRegistration, void(const std::string&, const std::string&)); |
23 MOCK_METHOD4(Register, void( | 23 MOCK_METHOD4(Register, void( |
24 enterprise_management::DeviceRegisterRequest::Type type, | 24 enterprise_management::DeviceRegisterRequest::Type type, |
25 const std::string&, | 25 const std::string&, |
26 const std::string&, | 26 const std::string&, |
27 bool)); | 27 bool)); |
28 MOCK_METHOD0(FetchPolicy, void(void)); | 28 MOCK_METHOD0(FetchPolicy, void(void)); |
29 MOCK_METHOD0(Unregister, void(void)); | 29 MOCK_METHOD0(Unregister, void(void)); |
| 30 MOCK_METHOD2(UploadCertificate, |
| 31 void(const std::string&, const StatusCallback&)); |
30 | 32 |
31 // Sets the DMToken. | 33 // Sets the DMToken. |
32 void SetDMToken(const std::string& token); | 34 void SetDMToken(const std::string& token); |
33 | 35 |
34 // Injects policy. | 36 // Injects policy. |
35 void SetPolicy(const PolicyNamespaceKey& policy_ns_key, | 37 void SetPolicy(const PolicyNamespaceKey& policy_ns_key, |
36 const enterprise_management::PolicyFetchResponse& policy); | 38 const enterprise_management::PolicyFetchResponse& policy); |
37 | 39 |
38 // Sets the status field. | 40 // Sets the status field. |
39 void SetStatus(DeviceManagementStatus status); | 41 void SetStatus(DeviceManagementStatus status); |
(...skipping 24 matching lines...) Expand all Loading... |
64 MOCK_METHOD1(OnRegistrationStateChanged, void(CloudPolicyClient*)); | 66 MOCK_METHOD1(OnRegistrationStateChanged, void(CloudPolicyClient*)); |
65 MOCK_METHOD1(OnClientError, void(CloudPolicyClient*)); | 67 MOCK_METHOD1(OnClientError, void(CloudPolicyClient*)); |
66 | 68 |
67 private: | 69 private: |
68 DISALLOW_COPY_AND_ASSIGN(MockCloudPolicyClientObserver); | 70 DISALLOW_COPY_AND_ASSIGN(MockCloudPolicyClientObserver); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace policy | 73 } // namespace policy |
72 | 74 |
73 #endif // CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_ | 75 #endif // CHROME_BROWSER_POLICY_CLOUD_MOCK_CLOUD_POLICY_CLIENT_H_ |
OLD | NEW |