| 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_DEVICE_MANAGEMENT_BACKEND_MOCK_H_ | |
| 6 #define CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_MOCK_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "chrome/browser/policy/device_management_backend.h" | |
| 10 #include "testing/gmock/include/gmock/gmock.h" | |
| 11 | |
| 12 namespace policy { | |
| 13 | |
| 14 // Mock classes for the various DeviceManagementBackend delegates that allow to | |
| 15 // capture callbacks using gmock. | |
| 16 class DeviceRegisterResponseDelegateMock | |
| 17 : public DeviceManagementBackend::DeviceRegisterResponseDelegate { | |
| 18 public: | |
| 19 DeviceRegisterResponseDelegateMock(); | |
| 20 virtual ~DeviceRegisterResponseDelegateMock(); | |
| 21 | |
| 22 MOCK_METHOD1(HandleRegisterResponse, | |
| 23 void(const enterprise_management::DeviceRegisterResponse&)); | |
| 24 MOCK_METHOD1(OnError, void(DeviceManagementBackend::ErrorCode error)); | |
| 25 }; | |
| 26 | |
| 27 class DeviceUnregisterResponseDelegateMock | |
| 28 : public DeviceManagementBackend::DeviceUnregisterResponseDelegate { | |
| 29 public: | |
| 30 DeviceUnregisterResponseDelegateMock(); | |
| 31 virtual ~DeviceUnregisterResponseDelegateMock(); | |
| 32 | |
| 33 MOCK_METHOD1(HandleUnregisterResponse, | |
| 34 void(const enterprise_management::DeviceUnregisterResponse&)); | |
| 35 MOCK_METHOD1(OnError, void(DeviceManagementBackend::ErrorCode error)); | |
| 36 }; | |
| 37 | |
| 38 class DevicePolicyResponseDelegateMock | |
| 39 : public DeviceManagementBackend::DevicePolicyResponseDelegate { | |
| 40 public: | |
| 41 DevicePolicyResponseDelegateMock(); | |
| 42 virtual ~DevicePolicyResponseDelegateMock(); | |
| 43 | |
| 44 MOCK_METHOD1(HandlePolicyResponse, | |
| 45 void(const enterprise_management::DevicePolicyResponse&)); | |
| 46 MOCK_METHOD1(OnError, void(DeviceManagementBackend::ErrorCode error)); | |
| 47 }; | |
| 48 | |
| 49 class DeviceAutoEnrollmentResponseDelegateMock | |
| 50 : public DeviceManagementBackend::DeviceAutoEnrollmentResponseDelegate { | |
| 51 public: | |
| 52 DeviceAutoEnrollmentResponseDelegateMock(); | |
| 53 virtual ~DeviceAutoEnrollmentResponseDelegateMock(); | |
| 54 | |
| 55 MOCK_METHOD1( | |
| 56 HandleAutoEnrollmentResponse, | |
| 57 void(const enterprise_management::DeviceAutoEnrollmentResponse&)); | |
| 58 MOCK_METHOD1(OnError, void(DeviceManagementBackend::ErrorCode error)); | |
| 59 }; | |
| 60 | |
| 61 } // namespace policy | |
| 62 | |
| 63 #endif // CHROME_BROWSER_POLICY_DEVICE_MANAGEMENT_BACKEND_MOCK_H_ | |
| OLD | NEW |