Chromium Code Reviews| 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 6c1fbe1a1edfa36e08991b43bf6021e98cbfe444..9eeacb8a66ca06894dc9701755e98f67244b4431 100644 |
| --- a/chrome/browser/policy/test/policy_testserver.py |
| +++ b/chrome/browser/policy/test/policy_testserver.py |
| @@ -202,6 +202,8 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): |
| return (400, 'Invalid request parameter') |
| if request_type == 'register': |
| return self.ProcessRegister(rmsg.register_request) |
| + if request_type == 'api_authorization': |
| + return self.ProcessApiAuthorization(rmsg.service_api_access_request) |
| elif request_type == 'unregister': |
| return self.ProcessUnregister(rmsg.unregister_request) |
| elif request_type == 'policy' or request_type == 'ping': |
| @@ -292,6 +294,25 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): |
| return (200, response.SerializeToString()) |
| + def ProcessApiAuthorization(self, msg): |
| + """Handles an API authorization request. |
| + |
| + Args: |
| + msg: The DeviceServiceApiAccessRequest message received from the client. |
| + |
| + Returns: |
| + A tuple of HTTP status code and response data to send to the client. |
| + """ |
| + |
| + # Prepare and send the response. |
| + response = dm.DeviceManagementResponse() |
| + response.service_api_access_response.CopyFrom( |
| + dm.DeviceServiceApiAccessResponse()) |
|
Mattias Nissler (ping if slow)
2013/04/22 10:59:00
Don't you need to put an access code string here t
David Roche
2013/04/23 01:36:08
Done.
|
| + |
| + self.DumpMessage('Response', response) |
| + |
| + return (200, response.SerializeToString()) |
| + |
| def ProcessUnregister(self, msg): |
| """Handles a register request. |