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

Unified Diff: tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py

Issue 6176005: Support int-typed policies in policy template generator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment Created 9 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 | « tools/grit/grit/format/policy_templates/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: tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py
diff --git a/tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py b/tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py
index 2464efdaac03698553c988e69200387ddf2d082c..5d1851e0c542ccfc0b473d98c97c1daa7e52391d 100644
--- a/tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py
+++ b/tools/grit/grit/format/policy_templates/writers/reg_writer_unittest.py
@@ -72,7 +72,7 @@ class RegWriterUnittest(writer_unittest_common.WriterUnittestCommon):
'Windows Registry Editor Version 5.00',
'',
'[HKEY_LOCAL_MACHINE\\Software\\Policies\\Google\\Chrome]',
- '"MainPolicy"=dword:1'])
+ '"MainPolicy"=dword:00000001'])
self.CompareOutputs(output, expected_output)
def testStringPolicy(self):
@@ -103,6 +103,34 @@ class RegWriterUnittest(writer_unittest_common.WriterUnittestCommon):
'"StringPolicy"="hello, world! \\\" \\\\"'])
self.CompareOutputs(output, expected_output)
+ def testIntPolicy(self):
+ # Tests a policy group with a single policy of type 'int'.
+ grd = self.PrepareTest(
+ '{'
+ ' "policy_definitions": ['
+ ' {'
+ ' "name": "IntPolicy",'
+ ' "type": "int",'
+ ' "supported_on": ["chrome.win:8-"],'
+ ' "annotations": {'
+ ' "example_value": 26'
+ ' }'
+ ' },'
+ ' ],'
+ ' "placeholders": [],'
+ '}',
+ '<messages>'
+ ' <message name="IDS_POLICY_INTPOLICY_CAPTION"></message>'
+ ' <message name="IDS_POLICY_INTPOLICY_DESC"></message>'
+ '</messages>')
+ output = self.GetOutput(grd, 'fr', {'_chromium' : '1'}, 'reg', 'en')
+ expected_output = self.NEWLINE.join([
+ 'Windows Registry Editor Version 5.00',
+ '',
+ '[HKEY_LOCAL_MACHINE\\Software\\Policies\\Chromium]',
+ '"IntPolicy"=dword:0000001a'])
+ self.CompareOutputs(output, expected_output)
+
def testIntEnumPolicy(self):
# Tests a policy group with a single policy of type 'int-enum'.
grd = self.PrepareTest(
@@ -136,7 +164,7 @@ class RegWriterUnittest(writer_unittest_common.WriterUnittestCommon):
'Windows Registry Editor Version 5.00',
'',
'[HKEY_LOCAL_MACHINE\\Software\\Policies\\Google\\Chrome]',
- '"EnumPolicy"=dword:1'])
+ '"EnumPolicy"=dword:00000001'])
self.CompareOutputs(output, expected_output)
def testStringEnumPolicy(self):
« no previous file with comments | « tools/grit/grit/format/policy_templates/writers/reg_writer.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698