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

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: 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
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 1a5c7e07e7007bbd70407f96f56804bfeddbc7d0..176bed156494e233706411579be7dcff6550c3ef 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -97,6 +97,16 @@ 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'}]
+ self.assertEquals(expected, getParams(schema, 'function20'))
+
+ expected = [{'items': {'$ref': 'other_namespace.SomeType'},
+ 'name': 'values',
+ 'type': 'array'}]
+ self.assertEquals(expected, getParams(schema, 'function21'))
+
def testNoCompile(self):
schema = self.idl_basics
func = getFunction(schema, 'function15')
@@ -117,20 +127,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': 'function22', 'type': 'integer'},
+ getReturns(schema, 'function22'))
+ self.assertEquals({'name': 'function23', '$ref': 'MyType1',
'optional': True},
- getReturns(schema, 'function20'))
- self.assertEquals({'name': 'function21', 'type': 'array',
+ getReturns(schema, 'function23'))
+ self.assertEquals({'name': 'function24', 'type': 'array',
'items': {'$ref': 'MyType1'}},
- getReturns(schema, 'function21'))
- self.assertEquals({'name': 'function22', '$ref': 'EnumType',
+ getReturns(schema, 'function24'))
+ self.assertEquals({'name': 'function25', '$ref': 'EnumType',
'optional': True},
- getReturns(schema, 'function22'))
- self.assertEquals({'name': 'function23', 'type': 'array',
+ getReturns(schema, 'function25'))
+ self.assertEquals({'name': 'function26', 'type': 'array',
'items': {'$ref': 'EnumType'}},
- getReturns(schema, 'function23'))
+ getReturns(schema, 'function26'))
+ self.assertEquals({'name': 'function27', '$ref': 'other_namespace.SomeType',
+ 'optional': True},
+ getReturns(schema, 'function27'))
+ self.assertEquals({'name': 'function28', 'type': 'array',
+ 'items': {'$ref': 'other_namespace.SomeType'}},
+ getReturns(schema, 'function28'))
def testChromeOSPlatformsNamespace(self):
schema = idl_schema.Load('test/idl_namespace_chromeos.idl')[0]

Powered by Google App Engine
This is Rietveld 408576698