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

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

Issue 342233005: Move ownership of the ComponentCloudPolicyService to the broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed comments Created 6 years, 6 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 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.

Powered by Google App Engine
This is Rietveld 408576698