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

Unified Diff: tools/json_schema_compiler/idl_schema_test.py

Issue 197873009: Support scoped types in PPAPI IDL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 9 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 | « ppapi/generators/idl_parser.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 81743175517076365993bab077fd08c818d56486..27cdaf12f5eecf76f1169f379d58a175068b4c35 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -100,6 +100,25 @@ class IdlSchemaTest(unittest.TestCase):
'type': 'array'}]
self.assertEquals(expected, getParams(schema, 'function14'))
+ def testScopedArguments(self):
+ schema = self.idl_basics
+ expected = [{'name':'value', '$ref':'other_namespace.SomeType'}]
not at google - send to devlin 2014/03/17 14:00:29 nit: spaces after the : (this file is oddly incons
mtomasz 2014/03/28 04:48:31 Done.
+ self.assertEquals(expected, getParams(schema, 'function20'))
+
+ expected = [{'items': {'$ref': 'other_namespace.SomeType'},
+ 'name': 'values',
+ 'type': 'array'}]
+ self.assertEquals(expected, getParams(schema, 'function21'))
+
+ expected = [{'name':'value',
+ '$ref':'other_namespace.sub_namespace.SomeType'}]
+ self.assertEquals(expected, getParams(schema, 'function22'))
+
+ expected = [{'items': {'$ref': 'other_namespace.sub_namespace.SomeType'},
+ 'name': 'values',
+ 'type': 'array'}]
+ self.assertEquals(expected, getParams(schema, 'function23'))
+
def testNoCompile(self):
schema = self.idl_basics
func = getFunction(schema, 'function15')
@@ -120,20 +139,26 @@ class IdlSchemaTest(unittest.TestCase):
def testReturnTypes(self):
schema = self.idl_basics
- self.assertEquals({'name': 'function19', 'type': 'integer'},
- getReturns(schema, 'function19'))
- self.assertEquals({'name': 'function20', '$ref': 'MyType1',
+ self.assertEquals({'name': 'function24', 'type': 'integer'},
+ getReturns(schema, 'function24'))
+ self.assertEquals({'name': 'function25', '$ref': 'MyType1',
'optional': True},
- getReturns(schema, 'function20'))
- self.assertEquals({'name': 'function21', 'type': 'array',
+ getReturns(schema, 'function25'))
+ self.assertEquals({'name': 'function26', 'type': 'array',
'items': {'$ref': 'MyType1'}},
- getReturns(schema, 'function21'))
- self.assertEquals({'name': 'function22', '$ref': 'EnumType',
+ getReturns(schema, 'function26'))
+ self.assertEquals({'name': 'function27', '$ref': 'EnumType',
'optional': True},
- getReturns(schema, 'function22'))
- self.assertEquals({'name': 'function23', 'type': 'array',
+ getReturns(schema, 'function27'))
+ self.assertEquals({'name': 'function28', 'type': 'array',
'items': {'$ref': 'EnumType'}},
- getReturns(schema, 'function23'))
+ getReturns(schema, 'function28'))
+ self.assertEquals({'name': 'function29', '$ref': 'other_namespace.SomeType',
+ 'optional': True},
+ getReturns(schema, 'function29'))
+ self.assertEquals({'name': 'function30', 'type': 'array',
+ 'items': {'$ref': 'other_namespace.SomeType'}},
+ getReturns(schema, 'function30'))
def testChromeOSPlatformsNamespace(self):
schema = idl_schema.Load('test/idl_namespace_chromeos.idl')[0]
« no previous file with comments | « ppapi/generators/idl_parser.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