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

Unified Diff: tools/json_schema_compiler/idl_schema_test.py

Issue 39113003: Docserver: Display enum value descriptions in API docs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 2 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/json_schema_compiler/idl_schema_test.py
diff --git a/tools/json_schema_compiler/idl_schema_test.py b/tools/json_schema_compiler/idl_schema_test.py
index 1f5d7d67ec24ce114fc96654c0077378895865db..e0a5c86cc8020399b80ebf76766ac5fbbb9506ab 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -77,7 +77,9 @@ class IdlSchemaTest(unittest.TestCase):
def testEnum(self):
schema = self.idl_basics
- expected = {'enum': ['name1', 'name2'], 'description': 'Enum description',
+ expected = {'enum': [{'name': 'name1', 'description': 'comment1'},
+ {'name': 'name2'}],
+ 'description': 'Enum description',
'type': 'string', 'id': 'EnumType'}
self.assertEquals(expected, getType(schema, expected['id']))
@@ -143,10 +145,12 @@ class IdlSchemaTest(unittest.TestCase):
schema = idl_schema.Load('test/idl_reserved_words.idl')[0]
foo_type = getType(schema, 'Foo')
- self.assertEquals(['float', 'DOMString'], foo_type['enum'])
+ self.assertEquals([{'name': 'float'}, {'name': 'DOMString'}],
+ foo_type['enum'])
enum_type = getType(schema, 'enum')
- self.assertEquals(['callback', 'namespace'], enum_type['enum'])
+ self.assertEquals([{'name': 'callback'}, {'name': 'namespace'}],
+ enum_type['enum'])
dictionary = getType(schema, 'dictionary')
self.assertEquals('integer', dictionary['properties']['long']['type'])

Powered by Google App Engine
This is Rietveld 408576698