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

Side by Side Diff: chrome/browser/policy/mock_device_management_backend.h

Issue 4121003: Implement device token fetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final feedback Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_
6 #define CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_
7 #pragma once
8
9 #include <string>
10
11 #include "chrome/browser/policy/device_management_backend.h"
12
13 namespace policy {
14
15 namespace em = enterprise_management;
16
17 // Useful for unit testing when a server-based backend isn't
18 // available. Simulates both successful and failed requests to the device
19 // management server.
20 class MockDeviceManagementBackend
21 : public DeviceManagementBackend {
22 public:
23 MockDeviceManagementBackend();
24 virtual ~MockDeviceManagementBackend() {}
25
26 void SetFailure(bool failure) { failure_ = failure; }
27
28 // DeviceManagementBackend method overrides:
29 virtual void ProcessRegisterRequest(
30 const std::string& auth_token,
31 const std::string& device_id,
32 const em::DeviceRegisterRequest& request,
33 DeviceRegisterResponseDelegate* delegate);
34
35 virtual void ProcessUnregisterRequest(
36 const std::string& device_management_token,
37 const em::DeviceUnregisterRequest& request,
38 DeviceUnregisterResponseDelegate* delegate);
39
40 virtual void ProcessPolicyRequest(
41 const std::string& device_management_token,
42 const em::DevicePolicyRequest& request,
43 DevicePolicyResponseDelegate* delegate);
44
45 private:
46 bool failure_;
47 DISALLOW_COPY_AND_ASSIGN(MockDeviceManagementBackend);
48 };
49
50 } // namespace policy
51
52 #endif // CHROME_BROWSER_POLICY_MOCK_DEVICE_MANAGEMENT_BACKEND_H_
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_token_fetcher_unittest.cc ('k') | chrome/browser/policy/mock_device_management_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698