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

Unified Diff: grit/format/policy_templates/policy_template_generator_unittest.py

Issue 347293003: Added support for string-enum-list. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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: grit/format/policy_templates/policy_template_generator_unittest.py
===================================================================
--- grit/format/policy_templates/policy_template_generator_unittest.py (revision 169)
+++ grit/format/policy_templates/policy_template_generator_unittest.py (working copy)
@@ -262,6 +262,29 @@
self.tester.assertEquals(policy['items'][2]['caption'], 'string3')
self.do_test(policy_data_mock, LocalMockWriter())
+ def testStringEnumTexts(self):
+ # Test that GUI messages are assigned correctly to string-enums
+ # (aka dropdown menus).
+ policy_data_mock = {
+ 'policy_definitions': [{
+ 'name': 'Policy1',
+ 'type': 'string-enum-list',
+ 'caption': '', 'desc': '',
+ 'supported_on': [],
+ 'items': [
+ {'name': 'item1', 'value': 'one', 'caption': 'string1', 'desc': ''},
+ {'name': 'item2', 'value': 'two', 'caption': 'string2', 'desc': ''},
+ {'name': 'item3', 'value': 'three', 'caption': 'string3', 'desc': ''},
+ ]
+ }]
+ }
+ class LocalMockWriter(mock_writer.MockWriter):
+ def WritePolicy(self, policy):
+ self.tester.assertEquals(policy['items'][0]['caption'], 'string1')
+ self.tester.assertEquals(policy['items'][1]['caption'], 'string2')
+ self.tester.assertEquals(policy['items'][2]['caption'], 'string3')
+ self.do_test(policy_data_mock, LocalMockWriter())
+
def testPolicyFiltering(self):
# Test that policies are filtered correctly based on their annotations.
policy_data_mock = {
« no previous file with comments | « grit/format/policy_templates/policy_template_generator.py ('k') | grit/format/policy_templates/writers/adm_writer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698