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

Unified Diff: tools/json_schema_compiler/idl_schema_test.py

Issue 11342033: Allow IDL schemas to have comments on callback functions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarify comment Created 8 years, 1 month 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/test/idl_basics.idl » ('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 bca451b4eb254888b16f08a5f8f37c849491323c..a71032346133d6078874c9e91c46c68f0faca00c 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -30,20 +30,20 @@ class IdlSchemaTest(unittest.TestCase):
def testSimpleCallbacks(self):
schema = self.idl_basics
- expected = [{'type':'function', 'name':'Callback1', 'parameters':[]}]
+ expected = [{'type':'function', 'name':'cb', 'parameters':[]}]
self.assertEquals(expected, getParams(schema, 'function4'))
- expected = [{'type':'function', 'name':'Callback2',
+ expected = [{'type':'function', 'name':'cb',
'parameters':[{'name':'x', 'type':'integer'}]}]
self.assertEquals(expected, getParams(schema, 'function5'))
- expected = [{'type':'function', 'name':'Callback3',
+ expected = [{'type':'function', 'name':'cb',
'parameters':[{'name':'arg', '$ref':'idl_basics.MyType1'}]}]
self.assertEquals(expected, getParams(schema, 'function6'))
def testCallbackWithArrayArgument(self):
schema = self.idl_basics
- expected = [{'type':'function', 'name':'Callback4',
+ expected = [{'type':'function', 'name':'cb',
'parameters':[{'name':'arg', 'type':'array',
'items':{'$ref':'idl_basics.MyType2'}}]}]
self.assertEquals(expected, getParams(schema, 'function12'))
@@ -70,7 +70,7 @@ class IdlSchemaTest(unittest.TestCase):
self.assertEquals(expected, getType(schema, expected['id']))
expected = [{'name':'type', '$ref':'idl_basics.EnumType'},
- {'type':'function', 'name':'Callback5',
+ {'type':'function', 'name':'cb',
'parameters':[{'name':'type', '$ref':'idl_basics.EnumType'}]}]
self.assertEquals(expected, getParams(schema, 'function13'))
@@ -90,6 +90,20 @@ class IdlSchemaTest(unittest.TestCase):
self.assertTrue(idl_basics['internal'])
self.assertFalse(idl_basics['nodoc'])
+ def testCallbackComment(self):
+ schema = self.idl_basics
+ self.assertEquals('A comment on a callback.',
+ getParams(schema, 'function16')[0]['description'])
+ self.assertEquals(
+ 'A parameter.',
+ getParams(schema, 'function16')[0]['parameters'][0]['description'])
+ self.assertEquals(
+ 'Just a parameter comment, with no comment on the callback.',
+ getParams(schema, 'function17')[0]['parameters'][0]['description'])
+ self.assertEquals(
+ 'Override callback comment.',
+ getParams(schema, 'function18')[0]['description'])
+
def testFunctionComment(self):
schema = self.idl_basics
func = getFunction(schema, 'function3')
« no previous file with comments | « tools/json_schema_compiler/idl_schema.py ('k') | tools/json_schema_compiler/test/idl_basics.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698