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 81b6bd5357f9920a1736213730b8c8f99520a005..93def9a3ba0386d7b3e5a63a0a5079ea178c0857 100644 |
--- a/chrome/browser/policy/test/policy_testserver.py |
+++ b/chrome/browser/policy/test/policy_testserver.py |
@@ -443,10 +443,12 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): |
self.server.UpdateStateKeys(token_info['device_token'], |
key_update_request.server_backed_state_key) |
- # If this is a publicaccount request then get the username now and use it |
- # in every PolicyFetchResponse produced. This is required to validate |
- # policy for extensions in public accounts. |
- username = self.server.GetPolicies().get('policy_user', None) |
+ # If this is a |publicaccount| request then get the |username| now and use |
bartfab (slow)
2014/06/20 16:41:11
Nit: s/request then/request,/
Joao da Silva
2014/06/20 17:25:33
Done.
|
+ # it in every PolicyFetchResponse produced. This is required to validate |
+ # policy for extensions in device-local accounts. |
+ # Unfortunately the username can't be obtained from |msg| because that |
bartfab (slow)
2014/06/20 16:41:11
Nit 1: s/Unfortunately/Unfortunately, /
Nit 2: s/u
Joao da Silva
2014/06/20 17:25:33
Done.
|
+ # requires interacting with GAIA. |
+ username = None |
for request in msg.policy_request.request: |
if request.policy_type == 'google/chromeos/publicaccount': |
username = request.settings_entity_id |
@@ -637,7 +639,7 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): |
settings.__getattribute__(field.name).CopyFrom(policy_message) |
def ProcessCloudPolicyForExtensions(self, request, response, token_info, |
- username): |
+ username=None): |
"""Handles a request for policy for extensions. |
A request for policy for extensions is slightly different from the other |
@@ -649,7 +651,7 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): |
response: The DevicePolicyResponse message for the response. Multiple |
PolicyFetchResponses will be appended to this message. |
token_info: The token extracted from the request. |
- username: The username for the response. |
+ username: The username for the response. May be None. |
""" |
# Send one PolicyFetchResponse for each extension that has |
# configuration data at the server. |