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

Unified Diff: components/policy/tools/template_writers/writers/adm_writer_unittest.py

Issue 2653823006: Include 'external' policies in grit output (admx, adm, doc etc.) (Closed)
Patch Set: Whitespace fix Created 3 years, 3 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: components/policy/tools/template_writers/writers/adm_writer_unittest.py
diff --git a/components/policy/tools/template_writers/writers/adm_writer_unittest.py b/components/policy/tools/template_writers/writers/adm_writer_unittest.py
index a6501ec8dc5a03b8e1606065a5518a607cb59986..a8911c7596dfcfb996903e5eda9b35f215a33624 100755
--- a/components/policy/tools/template_writers/writers/adm_writer_unittest.py
+++ b/components/policy/tools/template_writers/writers/adm_writer_unittest.py
@@ -803,6 +803,78 @@ chromium_recommended="Chromium - Recommended"
DictionaryPolicy_Policy="Caption of policy."
DictionaryPolicy_Explain="Description of group."
DictionaryPolicy_Part="Caption of policy."
+''')
+ self.CompareOutputs(output, expected_output)
+
+ def testExternalPolicy(self):
+ # Tests a policy group with a single policy of type 'external'.
+ policy_json = '''
+ {
+ 'policy_definitions': [
+ {
+ 'name': 'ExternalPolicy',
+ 'type': 'external',
+ 'supported_on': ['chrome.win:8-'],
+ 'features': { 'can_be_recommended': True },
+ 'desc': 'Description of group.',
+ 'caption': 'Caption of policy.',
+ },
+ ],
+ 'placeholders': [],
+ 'messages': {
+ 'win_supported_winxpsp2': {
+ 'text': 'At least Windows 3.13', 'desc': 'blah'
+ },
+ 'doc_recommended': {
+ 'text': 'Recommended', 'desc': 'bleh'
+ }
+ }
+ }'''
+ output = self.GetOutput(policy_json, {'_chromium' : '1'}, 'adm')
+ expected_output = self.ConstructOutput(
+ ['MACHINE', 'USER'], '''
+ CATEGORY !!chromium
+ KEYNAME "Software\\Policies\\Chromium"
+
+ POLICY !!ExternalPolicy_Policy
+ #if version >= 4
+ SUPPORTED !!SUPPORTED_WINXPSP2
+ #endif
+ EXPLAIN !!ExternalPolicy_Explain
+
+ PART !!ExternalPolicy_Part EDITTEXT
+ VALUENAME "ExternalPolicy"
+ MAXLEN 1000000
+ END PART
+ END POLICY
+
+ END CATEGORY
+
+ CATEGORY !!chromium_recommended
+ KEYNAME "Software\\Policies\\Chromium\\Recommended"
+
+ POLICY !!ExternalPolicy_Policy
+ #if version >= 4
+ SUPPORTED !!SUPPORTED_WINXPSP2
+ #endif
+ EXPLAIN !!ExternalPolicy_Explain
+
+ PART !!ExternalPolicy_Part EDITTEXT
+ VALUENAME "ExternalPolicy"
+ MAXLEN 1000000
+ END PART
+ END POLICY
+
+ END CATEGORY
+
+
+''', '''[Strings]
+SUPPORTED_WINXPSP2="At least Windows 3.13"
+chromium="Chromium"
+chromium_recommended="Chromium - Recommended"
+ExternalPolicy_Policy="Caption of policy."
+ExternalPolicy_Explain="Description of group."
+ExternalPolicy_Part="Caption of policy."
''')
self.CompareOutputs(output, expected_output)

Powered by Google App Engine
This is Rietveld 408576698