| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_POLICY_MOCK_CLOUD_POLICY_CLIENT_H_ |
| 6 #define CHROME_BROWSER_POLICY_MOCK_CLOUD_POLICY_CLIENT_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "chrome/browser/policy/cloud_policy_client.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 |
| 13 namespace policy { |
| 14 |
| 15 class MockCloudPolicyClient : public CloudPolicyClient { |
| 16 public: |
| 17 MockCloudPolicyClient(); |
| 18 virtual ~MockCloudPolicyClient(); |
| 19 |
| 20 MOCK_METHOD2(SetupRegistration, void(const std::string&, const std::string&)); |
| 21 MOCK_METHOD1(Register, void(const std::string&)); |
| 22 MOCK_METHOD0(FetchPolicy, void(void)); |
| 23 MOCK_METHOD0(Unregister, void(void)); |
| 24 |
| 25 // Sets the DMToken. |
| 26 void SetDMToken(const std::string& token); |
| 27 |
| 28 // Injects policy. |
| 29 void SetPolicy(const enterprise_management::PolicyFetchResponse& policy); |
| 30 |
| 31 // Sets the status field. |
| 32 void SetStatus(DeviceManagementStatus status); |
| 33 |
| 34 // Make the notification helpers public. |
| 35 using CloudPolicyClient::NotifyPolicyFetched; |
| 36 using CloudPolicyClient::NotifyRegistrationStateChanged; |
| 37 using CloudPolicyClient::NotifyClientError; |
| 38 |
| 39 using CloudPolicyClient::submit_machine_id_; |
| 40 using CloudPolicyClient::last_policy_timestamp_; |
| 41 using CloudPolicyClient::public_key_version_; |
| 42 using CloudPolicyClient::public_key_version_valid_; |
| 43 |
| 44 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(MockCloudPolicyClient); |
| 46 }; |
| 47 |
| 48 } // namespace policy |
| 49 |
| 50 #endif // CHROME_BROWSER_POLICY_MOCK_CLOUD_POLICY_CLIENT_H_ |
| OLD | NEW |