Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: chrome/browser/policy/mock_device_management_service.h

Issue 10449071: Enable user policy handling through the new cloud policy stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698