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

Unified Diff: components/policy/tools/template_writers/writers/reg_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
« no previous file with comments | « components/policy/tools/template_writers/writers/reg_writer.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/tools/template_writers/writers/reg_writer_unittest.py
diff --git a/components/policy/tools/template_writers/writers/reg_writer_unittest.py b/components/policy/tools/template_writers/writers/reg_writer_unittest.py
index 2e2d14e4e2c48be5e5336a9b25e2d2303ca442ae..adb9b8fd768d695bd08639057d659ffd5fefa0cf 100755
--- a/components/policy/tools/template_writers/writers/reg_writer_unittest.py
+++ b/components/policy/tools/template_writers/writers/reg_writer_unittest.py
@@ -318,6 +318,35 @@ class RegWriterUnittest(writer_unittest_common.WriterUnittestCommon):
'"b": 2}, "int": 10, "list": [1, 2, 3], "string": "abc"}"'])
self.CompareOutputs(output, expected_output)
+ def testExternalPolicy(self):
+ # Tests a policy group with a single policy of type 'external'.
+ example = {
+ 'url': "https://example.com/avatar.jpg",
+ 'hash': "deadbeef",
+ }
+ policy_json = '''
+ {
+ "policy_definitions": [
+ {
+ "name": "ExternalPolicy",
+ "type": "external",
+ "caption": "",
+ "desc": "",
+ "supported_on": ["chrome.win:8-"],
+ "example_value": %s
+ },
+ ],
+ "placeholders": [],
+ "messages": {},
+ }''' % str(example)
+ output = self.GetOutput(policy_json, {'_chromium' : '1'}, 'reg')
+ expected_output = self.NEWLINE.join([
+ 'Windows Registry Editor Version 5.00',
+ '',
+ '[HKEY_LOCAL_MACHINE\\Software\\Policies\\Chromium]',
+ '"ExternalPolicy"="{"hash": "deadbeef", "url": "https://example.com/avatar.jpg"}"'])
+ self.CompareOutputs(output, expected_output)
+
def testNonSupportedPolicy(self):
# Tests a policy that is not supported on Windows, so it shouldn't
# be included in the .REG file.
« no previous file with comments | « components/policy/tools/template_writers/writers/reg_writer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698