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

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

Issue 2278493004: Document ARC support for Chrome policies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typo. Created 4 years, 4 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: tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
diff --git a/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py b/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
index 515a08d5d406f0795418755361242c20c2ae39c3..b7a39d21bdf8ba82ee7e977814589ae9393ca3fd 100755
--- a/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
+++ b/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
@@ -48,6 +48,7 @@ class DocWriterUnittest(writer_unittest_common.WriterUnittestCommon):
'doc_complex_policies_on_windows': {'text': '_test_complex_policies_win'},
'doc_data_type': {'text': '_test_data_type'},
'doc_description': {'text': '_test_description'},
+ 'doc_arc_support': {'text': '_test_arc_support'},
'doc_description_column_title': {
'text': '_test_description_column_title'
},
@@ -434,7 +435,8 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
'until_version': '',
}],
'features': {'dynamic_refresh': False},
- 'example_value': False
+ 'example_value': False,
+ 'arc_support': 'TestArcSupportNote'
}
self.writer.messages['doc_since_version'] = {'text': '...$6...'}
self.writer._AddPolicyDetails(self.doc_root, policy)
@@ -463,11 +465,53 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
'<dt style="style_dt;">_test_supported_features</dt>'
'<dd>_test_feature_dynamic_refresh: _test_not_supported</dd>'
'<dt style="style_dt;">_test_description</dt><dd><p>TestPolicyDesc</p></dd>'
+ '<dt style="style_dt;">_test_arc_support</dt>'
+ '<dd><p>TestArcSupportNote</p></dd>'
'<dt style="style_dt;">_test_example_value</dt>'
'<dd>0x00000000 (Windows), false (Linux),'
' false (Android), &lt;false /&gt; (Mac)</dd>'
'</dl></root>')
+ def testAddPolicyDetailsNoArcSupport(self):
+ # Test that the entire Android-on-Chrome-OS sub-section is left out when
+ # 'arc_support' is not specified.
+ policy = {
+ 'type': 'main',
+ 'name': 'TestPolicyName',
+ 'caption': 'TestPolicyCaption',
+ 'desc': 'TestPolicyDesc',
+ 'supported_on': [{
+ 'product': 'chrome',
+ 'platforms': ['linux'],
+ 'since_version': '8',
+ 'until_version': '',
+ }],
+ 'features': {'dynamic_refresh': False},
+ 'example_value': False
+ }
+ self.writer.messages['doc_since_version'] = {'text': '...$6...'}
+ self.writer._AddPolicyDetails(self.doc_root, policy)
+ self.assertEquals(
+ self.doc_root.toxml(),
+ '<root><dl>'
+ '<dt style="style_dt;">_test_data_type</dt>'
+ '<dd>Boolean</dd>'
+ '<dt style="style_dt;">_test_mac_linux_pref_name</dt>'
+ '<dd style="style_.monospace;">TestPolicyName</dd>'
+ '<dt style="style_dt;">_test_supported_on</dt>'
+ '<dd>'
+ '<ul style="style_ul;">'
+ '<li>Chrome (Linux) ...8...</li>'
+ '</ul>'
+ '</dd>'
+ '<dt style="style_dt;">_test_supported_features</dt>'
+ '<dd>_test_feature_dynamic_refresh: _test_not_supported</dd>'
+ '<dt style="style_dt;">_test_description</dt>'
+ '<dd><p>TestPolicyDesc</p></dd>'
+ '<dt style="style_dt;">_test_example_value</dt>'
+ '<dd>false (Linux)</dd>'
+ '</dl></root>')
+
def testAddDictPolicyDetails(self):
# Test if the definition list (<dl>) of policy details is created correctly
# for 'dict' policies.
« no previous file with comments | « tools/grit/grit/format/policy_templates/writers/doc_writer.py ('k') | tools/grit/grit/gather/policy_json.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698