Commit 60ef9794 authored by Owen Min's avatar Owen Min Committed by Commit Bot

Cleanup few policy template presubmit warnings.

Also fix an issue in the presubmit script when supported_on is empty.

Change-Id: Ic72f06e05e11052fecba8dd013f28ba77a37848c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368174
Commit-Queue: Owen Min <zmin@chromium.org>
Reviewed-by: default avatarYann Dago <ydago@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800684}
parent 0a9d3e3e
......@@ -5713,7 +5713,6 @@
'caption': '''Do not allow any site to access sensors''',
}
],
'supported_on': [],
'future_on': ['chrome.*', 'chrome_os', 'android'],
'features': {
'dynamic_refresh': True,
......@@ -6583,7 +6582,6 @@
],
'type': 'main',
'schema': { 'type': 'boolean' },
'supported_on': [],
'future_on': [
'chrome.*',
'chrome_os',
......@@ -6625,7 +6623,6 @@
'type': 'array',
'items': { 'type': 'string' },
},
'supported_on': [],
'future_on': [
'chrome.*',
'chrome_os',
......@@ -6847,7 +6844,6 @@
'type': 'array',
'items': { 'type': 'string' },
},
'supported_on': [],
'future_on': ['chrome.*', 'chrome_os', 'android'],
'features': {
'dynamic_refresh': True,
......@@ -6873,7 +6869,6 @@
'type': 'array',
'items': { 'type': 'string' },
},
'supported_on': [],
'future_on': ['chrome.*', 'chrome_os', 'android'],
'features': {
'dynamic_refresh': True,
......@@ -16236,7 +16231,6 @@
'type': 'main',
'schema': { 'type': 'boolean' },
'future_on': ['chrome_os'],
'supported_on': [],
'features': {
'dynamic_refresh': True,
'per_profile': True,
......@@ -18637,8 +18631,8 @@
'items': { 'type': 'string' },
},
'supported_on': ['chrome.*:70-','android:70-','chrome_os:70-'],
'internal_only': True,
'features': {
'internal_only': True,
'dynamic_refresh': True,
'per_profile': True,
},
......@@ -23218,7 +23212,6 @@ If you disable this policy, web page scrolling to specific text fragments via UR
'owners': ['skym@chromium.org', 'wenyufu@chromium.org', 'twellington@chromium.org'],
'type': 'main',
'schema': { 'type': 'boolean' },
'supported_on': [],
'future_on': ['android'],
'features': {
'dynamic_refresh': False,
......@@ -88,6 +88,7 @@ class PolicyDetails:
features = policy.get('features', {})
self.can_be_recommended = features.get('can_be_recommended', False)
self.can_be_mandatory = features.get('can_be_mandatory', True)
self.internal_only = features.get('internal_only', False)
self.is_deprecated = policy.get('deprecated', False)
self.is_device_only = policy.get('device_only', False)
self.is_future = policy.get('future', False)
......@@ -1658,8 +1659,9 @@ def _WriteAppRestrictions(policies, policy_atomic_groups, target_platform, f,
f.write('<restrictions xmlns:android="'
'http://schemas.android.com/apk/res/android">\n\n')
for policy in policies:
if (policy.is_supported and policy.restriction_type != 'invalid' and
not policy.is_deprecated and not policy.is_future):
if (policy.is_supported and policy.restriction_type != 'invalid'
and not policy.is_deprecated and not policy.is_future
and not policy.internal_only):
WriteAppRestriction(policy)
f.write('</restrictions>')
......
......@@ -665,9 +665,9 @@ class PolicyTemplateChecker(object):
'policy', policy.get('name', policy))
# All user policies must have a per_profile feature flag.
if (not policy.get('device_only', False) and
not policy.get('deprecated', False) and
not filter(re.compile('^chrome_frame:.*').match, supported_on)):
if (not policy.get('device_only', False)
and not policy.get('deprecated', False)
and not 'chrome_frame' in supported_platforms):
self._CheckContains(
features,
'per_profile',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment