summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/mock_cloud_policy_client.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/policy/mock_cloud_policy_client.cc')
-rw-r--r--chrome/browser/policy/mock_cloud_policy_client.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome/browser/policy/mock_cloud_policy_client.cc b/chrome/browser/policy/mock_cloud_policy_client.cc
new file mode 100644
index 0000000..496745e
--- /dev/null
+++ b/chrome/browser/policy/mock_cloud_policy_client.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/policy/mock_cloud_policy_client.h"
+#include "chrome/browser/policy/proto/device_management_backend.pb.h"
+
+namespace em = enterprise_management;
+
+namespace policy {
+
+MockCloudPolicyClient::MockCloudPolicyClient()
+ : CloudPolicyClient("", "", USER_AFFILIATION_NONE, POLICY_SCOPE_USER, NULL,
+ NULL) {}
+
+MockCloudPolicyClient::~MockCloudPolicyClient() {}
+
+void MockCloudPolicyClient::SetDMToken(const std::string& token) {
+ dm_token_ = token;
+}
+
+void MockCloudPolicyClient::SetPolicy(const em::PolicyFetchResponse& policy) {
+ policy_.reset(new enterprise_management::PolicyFetchResponse(policy));
+}
+
+void MockCloudPolicyClient::SetStatus(DeviceManagementStatus status) {
+ status_ = status;
+}
+
+} // namespace policy