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

Unified Diff: tools/json_schema_compiler/idl_schema_test.py

Issue 10639020: Switch the downloads API over to IDL/json_schema_compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 f83d6166f135905bf930d406305c52be33fc6038..7ac2255684a83362ffd2937ae9ec02c916b763fb 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -56,11 +56,18 @@ class IdlSchemaTest(unittest.TestCase):
'parameters':[{'type':'integer', 'name':'x'}]}}]
self.assertEquals(expected, getParams(schema, 'whatever'))
+ def testLegalValues(self):
+ expected = {'x': {'name': 'x', 'type': 'integer', 'enum': [1,2],
+ 'description': 'This comment tests \\\"double-quotes\\\".'},
+ 'y': {'name': 'y', 'type': 'string'}}
+ self.assertEquals(expected, getType(
+ self.idl_basics, 'idl_basics.MyType1')['properties'])
+
def testEnum(self):
schema = self.idl_basics
- expected = {'enum': ['name1', 'name2'],
+ expected = {'enum': ['name1', 'name2'], 'description': 'Enum description',
'type': 'string', 'id': 'idl_basics.EnumType'}
- self.assertEquals(expected, getType(schema, 'idl_basics.EnumType'))
+ self.assertEquals(expected, getType(schema, expected['id']))
expected = [{'name':'type', '$ref':'idl_basics.EnumType'},
{'type':'function', 'name':'Callback5',

Powered by Google App Engine
This is Rietveld 408576698