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

Side by Side Diff: tools/json_schema_compiler/idl_schema_test.py

Issue 10435003: Add support for 'nocompile' to IDL schema compiler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import idl_schema 6 import idl_schema
7 import unittest 7 import unittest
8 8
9 def getFunction(schema, name): 9 def getFunction(schema, name):
10 for item in schema['functions']: 10 for item in schema['functions']:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 expected = [{'name':'type', '$ref':'idl_basics.EnumType'}, 65 expected = [{'name':'type', '$ref':'idl_basics.EnumType'},
66 {'type':'function', 'name':'Callback5', 66 {'type':'function', 'name':'Callback5',
67 'parameters':[{'name':'type', '$ref':'idl_basics.EnumType'}]}] 67 'parameters':[{'name':'type', '$ref':'idl_basics.EnumType'}]}]
68 self.assertEquals(expected, getParams(schema, 'function13')) 68 self.assertEquals(expected, getParams(schema, 'function13'))
69 69
70 expected = [{'items': {'$ref': 'idl_basics.EnumType'}, 'name': 'types', 70 expected = [{'items': {'$ref': 'idl_basics.EnumType'}, 'name': 'types',
71 'type': 'array'}] 71 'type': 'array'}]
72 self.assertEquals(expected, getParams(schema, 'function14')) 72 self.assertEquals(expected, getParams(schema, 'function14'))
73 73
74 def testNoCompile(self):
75 schema = self.idl_basics
76 func = getFunction(schema, 'function15')
77 self.assertTrue(func != None)
miket_OOO 2012/05/23 22:02:28 Says PEP8: "Comparisons to singletons like None sh
asargent_no_longer_on_chrome 2012/05/23 22:21:07 Done.
78 self.assertTrue(func['nocompile'])
79
74 if __name__ == '__main__': 80 if __name__ == '__main__':
75 unittest.main() 81 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698