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

Unified Diff: chrome/browser/policy/test/policy_testserver.py

Issue 1767443002: Add enterprise enrollment support for fake users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Check instance before derefing it Created 4 years, 8 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/test/policy_testserver.py
diff --git a/chrome/browser/policy/test/policy_testserver.py b/chrome/browser/policy/test/policy_testserver.py
index c7f933dd082ab81562dce20ec1e5048011174601..316d855de6ceb6784937dd47d4f7f6816e0420e4 100644
--- a/chrome/browser/policy/test/policy_testserver.py
+++ b/chrome/browser/policy/test/policy_testserver.py
@@ -308,6 +308,12 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
elif request_type == 'status_upload':
response = self.ProcessStatusUploadRequest(
rmsg.device_status_report_request, rmsg.session_status_report_request)
+ elif request_type == 'device_attribute_update_permission':
+ response = self.ProcessDeviceAttributeUpdatePermissionRequest()
+ elif request_type == 'device_attribute_update':
+ response = self.ProcessDeviceAttributeUpdateRequest()
+ elif request_type == 'remote_commands':
+ response = self.ProcessRemoteCommandsRequest()
else:
return (400, 'Invalid request parameter')
@@ -586,6 +592,38 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
return (200, response)
+ def ProcessDeviceAttributeUpdatePermissionRequest(self):
+ """Handles a device attribute update permission request.
+
+ Returns:
+ A tuple of HTTP status code and response data to send to the client.
+ """
+ response = dm.DeviceManagementResponse()
+ response.device_attribute_update_permission_response.result = (
+ dm.DeviceAttributeUpdatePermissionResponse.ATTRIBUTE_UPDATE_ALLOWED)
+
+ return (200, response)
+
+ def ProcessDeviceAttributeUpdateRequest(self):
+ """Handles a device attribute update request.
+
+ Returns:
+ A tuple of HTTP status code and response data to send to the client.
+ """
+ response = dm.DeviceManagementResponse()
+ response.device_attribute_update_response.result = (
+ dm.DeviceAttributeUpdateResponse.ATTRIBUTE_UPDATE_SUCCESS)
+
+ return (200, response)
+
+ def ProcessRemoteCommandsRequest(self):
+ """Handles a remote command request.
+
+ Returns:
+ A tuple of HTTP status code and response data to send to the client.
+ """
+ return (200, '')
+
def SetProtobufMessageField(self, group_message, field, field_value):
"""Sets a field in a protobuf message.
« no previous file with comments | « chrome/browser/chromeos/policy/wildcard_login_checker.cc ('k') | chrome/browser/resources/chromeos/login/login_shared.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698