| Index: chrome/browser/policy/mock_device_management_service.h
|
| diff --git a/chrome/browser/policy/mock_device_management_service.h b/chrome/browser/policy/mock_device_management_service.h
|
| index 51593bffba50dd71733ade17bcbb1ad4f4b6af8e..c8c5828775d3c5cdd87825711e8f4f106e3bf278 100644
|
| --- a/chrome/browser/policy/mock_device_management_service.h
|
| +++ b/chrome/browser/policy/mock_device_management_service.h
|
| @@ -10,10 +10,19 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "chrome/browser/policy/device_management_service.h"
|
| +#include "chrome/browser/policy/proto/device_management_backend.pb.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
|
|
| namespace policy {
|
|
|
| +class MockDeviceManagementJob {
|
| + public:
|
| + virtual ~MockDeviceManagementJob();
|
| + virtual void SendResponse(
|
| + DeviceManagementStatus status,
|
| + const enterprise_management::DeviceManagementResponse& response) = 0;
|
| +};
|
| +
|
| class MockDeviceManagementService : public DeviceManagementService {
|
| public:
|
| MockDeviceManagementService();
|
| @@ -36,9 +45,15 @@ class MockDeviceManagementService : public DeviceManagementService {
|
| // Creates a gmock action that will make the job succeed.
|
| testing::Action<CreateJobFunction> SucceedJob(
|
| const enterprise_management::DeviceManagementResponse& response);
|
| +
|
| // Creates a gmock action which will fail the job with the given error.
|
| testing::Action<CreateJobFunction> FailJob(DeviceManagementStatus status);
|
|
|
| + // Creates a gmock action which will capture the job so the test code can
|
| + // delay job completion.
|
| + testing::Action<CreateJobFunction> CreateAsyncJob(
|
| + MockDeviceManagementJob** job);
|
| +
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementService);
|
| };
|
|
|