| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ |
| 6 #define CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ | 6 #define CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 const std::string& device_id, | 35 const std::string& device_id, |
| 36 const em::DeviceRegisterRequest& request, | 36 const em::DeviceRegisterRequest& request, |
| 37 DeviceRegisterResponseDelegate* delegate)); | 37 DeviceRegisterResponseDelegate* delegate)); |
| 38 | 38 |
| 39 MOCK_METHOD4(ProcessUnregisterRequest, void( | 39 MOCK_METHOD4(ProcessUnregisterRequest, void( |
| 40 const std::string& device_management_token, | 40 const std::string& device_management_token, |
| 41 const std::string& device_id, | 41 const std::string& device_id, |
| 42 const em::DeviceUnregisterRequest& request, | 42 const em::DeviceUnregisterRequest& request, |
| 43 DeviceUnregisterResponseDelegate* delegate)); | 43 DeviceUnregisterResponseDelegate* delegate)); |
| 44 | 44 |
| 45 MOCK_METHOD5(ProcessPolicyRequest, void( | 45 MOCK_METHOD6(ProcessPolicyRequest, void( |
| 46 const std::string& device_management_token, | 46 const std::string& device_management_token, |
| 47 const std::string& device_id, | 47 const std::string& device_id, |
| 48 CloudPolicyDataStore::UserAffiliation affiliation, | 48 CloudPolicyDataStore::UserAffiliation affiliation, |
| 49 const em::DevicePolicyRequest& request, | 49 const em::DevicePolicyRequest& request, |
| 50 const em::DeviceStatusReportRequest* device_status, |
| 50 DevicePolicyResponseDelegate* delegate)); | 51 DevicePolicyResponseDelegate* delegate)); |
| 51 | 52 |
| 52 MOCK_METHOD3(ProcessAutoEnrollmentRequest, void( | 53 MOCK_METHOD3(ProcessAutoEnrollmentRequest, void( |
| 53 const std::string& device_id, | 54 const std::string& device_id, |
| 54 const em::DeviceAutoEnrollmentRequest& request, | 55 const em::DeviceAutoEnrollmentRequest& request, |
| 55 DeviceAutoEnrollmentResponseDelegate* delegate)); | 56 DeviceAutoEnrollmentResponseDelegate* delegate)); |
| 56 | 57 |
| 57 private: | 58 private: |
| 58 DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementBackend); | 59 DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementBackend); |
| 59 }; | 60 }; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 80 signed_response.set_timestamp(timestamp.InMilliseconds()); | 81 signed_response.set_timestamp(timestamp.InMilliseconds()); |
| 81 std::string serialized_signed_response; | 82 std::string serialized_signed_response; |
| 82 EXPECT_TRUE(signed_response.SerializeToString(&serialized_signed_response)); | 83 EXPECT_TRUE(signed_response.SerializeToString(&serialized_signed_response)); |
| 83 em::DevicePolicyResponse response; | 84 em::DevicePolicyResponse response; |
| 84 em::PolicyFetchResponse* fetch_response = response.add_response(); | 85 em::PolicyFetchResponse* fetch_response = response.add_response(); |
| 85 fetch_response->set_policy_data(serialized_signed_response); | 86 fetch_response->set_policy_data(serialized_signed_response); |
| 86 // TODO(jkummerow): Set proper new_public_key and signature (when | 87 // TODO(jkummerow): Set proper new_public_key and signature (when |
| 87 // implementing support for signature verification). | 88 // implementing support for signature verification). |
| 88 fetch_response->set_policy_data_signature("TODO"); | 89 fetch_response->set_policy_data_signature("TODO"); |
| 89 fetch_response->set_new_public_key("TODO"); | 90 fetch_response->set_new_public_key("TODO"); |
| 90 arg4->HandlePolicyResponse(response); | 91 arg5->HandlePolicyResponse(response); |
| 91 } | 92 } |
| 92 | 93 |
| 93 ACTION_P(MockDeviceManagementBackendFailRegister, error) { | 94 ACTION_P(MockDeviceManagementBackendFailRegister, error) { |
| 94 arg4->OnError(error); | 95 arg4->OnError(error); |
| 95 } | 96 } |
| 96 | 97 |
| 97 ACTION_P(MockDeviceManagementBackendFailPolicy, error) { | 98 ACTION_P(MockDeviceManagementBackendFailPolicy, error) { |
| 98 arg4->OnError(error); | 99 arg5->OnError(error); |
| 99 } | 100 } |
| 100 | 101 |
| 101 } // namespace policy | 102 } // namespace policy |
| 102 | 103 |
| 103 #endif // CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ | 104 #endif // CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ |
| OLD | NEW |