| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 const std::string& device_id, | 40 const std::string& device_id, |
| 41 const em::DeviceUnregisterRequest& request, | 41 const em::DeviceUnregisterRequest& request, |
| 42 DeviceUnregisterResponseDelegate* delegate)); | 42 DeviceUnregisterResponseDelegate* delegate)); |
| 43 | 43 |
| 44 MOCK_METHOD4(ProcessPolicyRequest, void( | 44 MOCK_METHOD4(ProcessPolicyRequest, void( |
| 45 const std::string& device_management_token, | 45 const std::string& device_management_token, |
| 46 const std::string& device_id, | 46 const std::string& device_id, |
| 47 const em::DevicePolicyRequest& request, | 47 const em::DevicePolicyRequest& request, |
| 48 DevicePolicyResponseDelegate* delegate)); | 48 DevicePolicyResponseDelegate* delegate)); |
| 49 | 49 |
| 50 MOCK_METHOD4(ProcessCloudPolicyRequest, void( |
| 51 const std::string& device_management_token, |
| 52 const std::string& device_id, |
| 53 const em::CloudPolicyRequest& request, |
| 54 DevicePolicyResponseDelegate* delegate)); |
| 55 |
| 50 private: | 56 private: |
| 51 DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementBackend); | 57 DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementBackend); |
| 52 }; | 58 }; |
| 53 | 59 |
| 54 ACTION(MockDeviceManagementBackendSucceedRegister) { | 60 ACTION(MockDeviceManagementBackendSucceedRegister) { |
| 55 em::DeviceRegisterResponse response; | 61 em::DeviceRegisterResponse response; |
| 56 std::string token("FAKE_DEVICE_TOKEN_"); | 62 std::string token("FAKE_DEVICE_TOKEN_"); |
| 57 static int next_token_suffix; | 63 static int next_token_suffix; |
| 58 token += next_token_suffix++; | 64 token += next_token_suffix++; |
| 59 response.set_device_management_token(token); | 65 response.set_device_management_token(token); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 78 arg3->OnError(error); | 84 arg3->OnError(error); |
| 79 } | 85 } |
| 80 | 86 |
| 81 ACTION_P(MockDeviceManagementBackendFailPolicy, error) { | 87 ACTION_P(MockDeviceManagementBackendFailPolicy, error) { |
| 82 arg3->OnError(error); | 88 arg3->OnError(error); |
| 83 } | 89 } |
| 84 | 90 |
| 85 } // namespace policy | 91 } // namespace policy |
| 86 | 92 |
| 87 #endif // CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ | 93 #endif // CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_ |
| OLD | NEW |