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

Unified Diff: components/policy/tools/template_writers/writers/adml_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/adml_writer_unittest.py
diff --git a/components/policy/tools/template_writers/writers/adml_writer_unittest.py b/components/policy/tools/template_writers/writers/adml_writer_unittest.py
index c30534a49d315807e279b8b3f98bd4e29258c60e..f0a03e7d4c4dcae0ce64621e54d0d976b5ae7407 100755
--- a/components/policy/tools/template_writers/writers/adml_writer_unittest.py
+++ b/components/policy/tools/template_writers/writers/adml_writer_unittest.py
@@ -405,6 +405,33 @@ class AdmlWriterUnittest(xml_writer_base_unittest.XmlWriterBaseTest):
'</presentation>')
self.AssertXMLEquals(output, expected_output)
+ def testExternalPolicy(self):
+ external_policy = {
+ 'name': 'ExternalPolicyStub',
+ 'type': 'external',
+ 'caption': 'External policy caption',
+ 'label': 'External policy label',
+ 'desc': 'This is a test description.',
+ }
+ self._InitWriterForAddingPolicies(self.writer, external_policy)
+ self.writer.WritePolicy(external_policy)
+ # Assert generated string elements.
+ output = self.GetXMLOfChildren(self.writer._string_table_elem)
+ expected_output = (
+ '<string id="ExternalPolicyStub">External policy caption</string>\n'
+ '<string id="ExternalPolicyStub_Explain">'
+ 'This is a test description.</string>')
+ self.AssertXMLEquals(output, expected_output)
+ # Assert generated presentation elements.
+ output = self.GetXMLOfChildren(self.writer._presentation_table_elem)
+ expected_output = (
+ '<presentation id="ExternalPolicyStub">\n'
+ ' <textBox refId="ExternalPolicyStub">\n'
+ ' <label>External policy label</label>\n'
+ ' </textBox>\n'
+ '</presentation>')
+ self.AssertXMLEquals(output, expected_output)
+
def testPlatform(self):
# Test that the writer correctly chooses policies of platform Windows.
self.assertTrue(self.writer.IsPolicySupported({

Powered by Google App Engine
This is Rietveld 408576698