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

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

Issue 5348001: Device management constants cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nit; fix DMPolicyCache unit tests 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
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 #include "chrome/browser/policy/mock_device_management_backend.h" 5 #include "chrome/browser/policy/mock_device_management_backend.h"
6 #include "chrome/browser/policy/proto/device_management_constants.h"
6 7
7 #include "base/basictypes.h" 8 #include "base/basictypes.h"
8 #include "base/logging.h" 9 #include "base/logging.h"
9 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
10 11
11 namespace { 12 namespace {
12 13
13 static const char kFakeDeviceManagementToken[] = "FAKE_DEVICE_TOKEN_"; 14 static const char kFakeDeviceManagementToken[] = "FAKE_DEVICE_TOKEN_";
14 static char next_token_suffix_ = '0'; 15 static char next_token_suffix_ = '0';
15 16
(...skipping 10 matching lines...) Expand all
26 using em::DeviceRegisterResponse; 27 using em::DeviceRegisterResponse;
27 using em::DeviceUnregisterResponse; 28 using em::DeviceUnregisterResponse;
28 using em::DevicePolicyResponse; 29 using em::DevicePolicyResponse;
29 30
30 MockDeviceManagementBackend::MockDeviceManagementBackend() 31 MockDeviceManagementBackend::MockDeviceManagementBackend()
31 : DeviceManagementBackend(), 32 : DeviceManagementBackend(),
32 policy_remaining_fail_count_(0), 33 policy_remaining_fail_count_(0),
33 register_remaining_fail_count_(0), 34 register_remaining_fail_count_(0),
34 policy_remaining_success_count_(0) { 35 policy_remaining_success_count_(0) {
35 policy_setting_ = policy_response_.add_setting(); 36 policy_setting_ = policy_response_.add_setting();
36 policy_setting_->set_policy_key("chrome-policy"); 37 policy_setting_->set_policy_key(kChromeDevicePolicySettingKey);
37 policy_setting_->set_watermark("fresh"); 38 policy_setting_->set_watermark("fresh");
38 } 39 }
39 40
40 MockDeviceManagementBackend::~MockDeviceManagementBackend() { 41 MockDeviceManagementBackend::~MockDeviceManagementBackend() {
41 } 42 }
42 43
43 void MockDeviceManagementBackend::AllShouldSucceed() { 44 void MockDeviceManagementBackend::AllShouldSucceed() {
44 ON_CALL(*this, ProcessRegisterRequest(_, _, _, _)). 45 ON_CALL(*this, ProcessRegisterRequest(_, _, _, _)).
45 WillByDefault(Invoke( 46 WillByDefault(Invoke(
46 this, 47 this,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 155
155 void MockDeviceManagementBackend::SimulateUnmanagedRegisterRequest( 156 void MockDeviceManagementBackend::SimulateUnmanagedRegisterRequest(
156 const std::string& auth_token, 157 const std::string& auth_token,
157 const std::string& device_id, 158 const std::string& device_id,
158 const em::DeviceRegisterRequest& request, 159 const em::DeviceRegisterRequest& request,
159 DeviceRegisterResponseDelegate* delegate) { 160 DeviceRegisterResponseDelegate* delegate) {
160 delegate->OnError(kErrorServiceManagementNotSupported); 161 delegate->OnError(kErrorServiceManagementNotSupported);
161 } 162 }
162 163
163 } // namespace 164 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_management_service_unittest.cc ('k') | chrome/browser/policy/proto/device_management_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698