Chromium Code Reviews| Index: tools/grit/grit/format/policy_templates/writers/admx_writer_unittest.py |
| diff --git a/tools/grit/grit/format/policy_templates/writers/admx_writer_unittest.py b/tools/grit/grit/format/policy_templates/writers/admx_writer_unittest.py |
| index c645be0b94eb02a98fe441ae474a92c07a9d6f0c..5f35511fca1ed2defe371caf4a1de1dc3dc4e00b 100644 |
| --- a/tools/grit/grit/format/policy_templates/writers/admx_writer_unittest.py |
| +++ b/tools/grit/grit/format/policy_templates/writers/admx_writer_unittest.py |
| @@ -201,13 +201,13 @@ class AdmxWriterTest(xml_writer_base_unittest.XmlWriterBaseTest): |
| '</policy>') |
| self.AssertXMLEquals(output, expected_output) |
| - def testEnumPolicy(self): |
| + def testIntEnumPolicy(self): |
| enum_policy = { |
| 'name': 'SampleEnumPolicy', |
| - 'type': 'enum', |
| + 'type': 'int-enum', |
| 'items': [ |
| - {'name': 'item 1', 'value': '0'}, |
| - {'name': 'item 2', 'value': '1'}, |
| + {'name': 'item 1', 'value': 0}, |
| + {'name': 'item 2', 'value': 1}, |
| ] |
| } |
| @@ -238,6 +238,43 @@ class AdmxWriterTest(xml_writer_base_unittest.XmlWriterBaseTest): |
| '</policy>') |
| self.AssertXMLEquals(output, expected_output) |
| + def testStringEnumPolicy(self): |
| + enum_policy = { |
| + 'name': 'SampleEnumPolicy', |
| + 'type': 'string-enum', |
| + 'items': [ |
| + {'name': 'item 1', 'value': 'one'}, |
|
gfeher
2011/01/03 10:30:10
I know this was already here, but please rename to
danno
2011/01/07 12:24:25
Done.
|
| + {'name': 'item 2', 'value': 'two'}, |
| + ] |
| + } |
| + |
| + self._initWriterForPolicy(self.writer, enum_policy) |
| + self.writer.WritePolicy(enum_policy) |
| + output = self.GetXMLOfChildren(self._GetPoliciesElement(self.writer._doc)) |
| + expected_output = ( |
| + '<policy class="TestClass" displayName="$(string.SampleEnumPolicy)"' |
| + ' explainText="$(string.SampleEnumPolicy_Explain)"' |
| + ' key="Software\\Policies\\Test" name="SampleEnumPolicy"' |
| + ' presentation="$(presentation.SampleEnumPolicy)">\n' |
| + ' <parentCategory ref="PolicyGroup"/>\n' |
| + ' <supportedOn ref="SUPPORTED_TESTOS"/>\n' |
| + ' <elements>\n' |
| + ' <enum id="SampleEnumPolicy" valueName="SampleEnumPolicy">\n' |
| + ' <item displayName="$(string.item 1)">\n' |
| + ' <value>\n' |
| + ' <string value="one"/>\n' |
| + ' </value>\n' |
| + ' </item>\n' |
| + ' <item displayName="$(string.item 2)">\n' |
| + ' <value>\n' |
| + ' <string value="two"/>\n' |
| + ' </value>\n' |
| + ' </item>\n' |
| + ' </enum>\n' |
| + ' </elements>\n' |
| + '</policy>') |
| + self.AssertXMLEquals(output, expected_output) |
| + |
| def testListPolicy(self): |
| list_policy = { |
| 'name': 'SampleListPolicy', |