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

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: merge Created 8 years, 5 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
« no previous file with comments | « tools/json_schema_compiler/idl_schema.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..71bf9870d15df4204fa5684e1ec1b45a59a49d8d 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):
+ self.assertEquals({
+ 'x': {'name': 'x', 'type': 'integer', 'enum': [1,2],
+ 'description': 'This comment tests \\\"double-quotes\\\".'},
+ 'y': {'name': 'y', 'type': 'string'}},
+ 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',
« no previous file with comments | « tools/json_schema_compiler/idl_schema.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698