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

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

Issue 132033002: Add support for Android and iOS policy fetch types to the testserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71eea6df03bcd1295f0c30dd5ac7d4b564f9b230..6659495ff68a4163196e8789cafb9a57c32117f1 100644
--- a/chrome/browser/policy/test/policy_testserver.py
+++ b/chrome/browser/policy/test/policy_testserver.py
@@ -364,11 +364,13 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
for request in msg.request:
fetch_response = response.policy_response.response.add()
if (request.policy_type in
- ('google/chrome/user',
- 'google/chromeos/user',
+ ('google/android/user',
+ 'google/chrome/extension',
'google/chromeos/device',
'google/chromeos/publicaccount',
- 'google/chrome/extension')):
+ 'google/chromeos/user',
+ 'google/chrome/user',
+ 'google/ios/user')):
if request_type != 'policy':
fetch_response.error_code = 400
fetch_response.error_message = 'Invalid request type'
@@ -543,9 +545,11 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
if msg.settings_entity_id:
policy_key += '/' + msg.settings_entity_id
if msg.policy_type in token_info['allowed_policy_types']:
- if (msg.policy_type == 'google/chromeos/user' or
- msg.policy_type == 'google/chrome/user' or
- msg.policy_type == 'google/chromeos/publicaccount'):
+ if msg.policy_type in ('google/android/user',
+ 'google/chromeos/publicaccount',
+ 'google/chromeos/user',
+ 'google/chrome/user',
+ 'google/ios/user'):
settings = cp.CloudPolicySettings()
payload = self.server.ReadPolicyFromDataDir(policy_key, settings)
if payload is None:
@@ -777,6 +781,12 @@ class PolicyTestServer(testserver_base.BrokenPipeHandlerMixIn,
'google/chromeos/device',
'google/chromeos/publicaccount'
],
+ dm.DeviceRegisterRequest.ANDROID_BROWSER: [
+ 'google/android/user'
+ ],
+ dm.DeviceRegisterRequest.IOS_BROWSER: [
+ 'google/ios/user'
+ ],
dm.DeviceRegisterRequest.TT: ['google/chromeos/user',
'google/chrome/user'],
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698