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

Unified Diff: components/policy/tools/template_writers/writers/plist_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/plist_writer_unittest.py
diff --git a/components/policy/tools/template_writers/writers/plist_writer_unittest.py b/components/policy/tools/template_writers/writers/plist_writer_unittest.py
index 8ffa219f8f9563a65d24ca071dbbe8ea58be6c2e..57727acdc7a2935c3baa65c3cdcedfc5f3caee08 100755
--- a/components/policy/tools/template_writers/writers/plist_writer_unittest.py
+++ b/components/policy/tools/template_writers/writers/plist_writer_unittest.py
@@ -629,6 +629,51 @@ class PListWriterUnittest(writer_unittest_common.WriterUnittestCommon):
</array>''')
self.assertEquals(output.strip(), expected_output.strip())
+ def testExternalPolicy(self):
+ # Tests a policy group with a single policy of type 'dict'.
+ policy_json = '''
+ {
+ 'policy_definitions': [
+ {
+ 'name': 'ExternalGroup',
+ 'type': 'group',
+ 'desc': '',
+ 'caption': '',
+ 'policies': [{
+ 'name': 'ExternalPolicy',
+ 'type': 'external',
+ 'supported_on': ['chrome.mac:8-'],
+ 'desc': '',
+ 'caption': '',
+ }],
+ },
+ ],
+ 'placeholders': [],
+ 'messages': {},
+ }'''
+ output = self.GetOutput(
+ policy_json,
+ {'_chromium' : '1', 'mac_bundle_id': 'com.example.Test'},
+ 'plist')
+ expected_output = self._GetExpectedOutputs(
+ 'Chromium', 'com.example.Test', '''<array>
+ <dict>
+ <key>pfm_name</key>
+ <string>ExternalPolicy</string>
+ <key>pfm_description</key>
+ <string/>
+ <key>pfm_title</key>
+ <string/>
+ <key>pfm_targets</key>
+ <array>
+ <string>user-managed</string>
+ </array>
+ <key>pfm_type</key>
+ <string>dictionary</string>
+ </dict>
+ </array>''')
+ self.assertEquals(output.strip(), expected_output.strip())
+
def testNonSupportedPolicy(self):
# Tests a policy that is not supported on Mac, so it shouldn't
# be included in the plist file.

Powered by Google App Engine
This is Rietveld 408576698