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

Unified Diff: tools/grit/grit/format/policy_templates/writers/doc_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
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 6a5fd42026699edab5c24d1ed0ac84b1523bc0b1..9aafd118ae3b8386b565c14baa4ef82beeb91fe5 100644
--- a/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
+++ b/tools/grit/grit/format/policy_templates/writers/doc_writer_unittest.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -315,6 +315,20 @@ See <a href="http://policy-explanation.example.com">http://policy-explanation.ex
self.doc_root.toxml(),
'<root>&quot;awesome-example&quot;</root>')
+ def testIntExample(self):
+ # Test representation of 'int' example values.
+ policy = {
+ 'name': 'PolicyName',
+ 'type': 'int',
+ 'annotations': {
+ 'example_value': 26
+ }
+ }
+ self.writer._AddExample(self.doc_root, policy)
+ self.assertEquals(
+ self.doc_root.toxml(),
+ '<root>0x0000001a (Windows), 26 (Linux/Mac)</root>')
+
def testAddPolicyAttribute(self):
# Test creating a policy attribute term-definition pair.
self.writer._AddPolicyAttribute(

Powered by Google App Engine
This is Rietveld 408576698