Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 from json_parse import OrderedDict | 9 from json_parse import OrderedDict |
| 10 | 10 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 'name': 'values', | 119 'name': 'values', |
| 120 'type': 'array'}] | 120 'type': 'array'}] |
| 121 self.assertEquals(expected, getParams(schema, 'function23')) | 121 self.assertEquals(expected, getParams(schema, 'function23')) |
| 122 | 122 |
| 123 def testNoCompile(self): | 123 def testNoCompile(self): |
| 124 schema = self.idl_basics | 124 schema = self.idl_basics |
| 125 func = getFunction(schema, 'function15') | 125 func = getFunction(schema, 'function15') |
| 126 self.assertTrue(func is not None) | 126 self.assertTrue(func is not None) |
| 127 self.assertTrue(func['nocompile']) | 127 self.assertTrue(func['nocompile']) |
| 128 | 128 |
| 129 def testNoDefine(self): | |
|
Devlin
2016/02/29 20:38:16
It might also be nice to test add a test that thes
tommycli
2016/02/29 21:53:31
I added a test in the latest patchset in the same
| |
| 130 schema = self.idl_basics | |
| 131 func = getFunction(schema, 'function31') | |
| 132 self.assertTrue(func is not None) | |
| 133 self.assertTrue(func['nodefine']) | |
| 134 | |
| 129 def testNoDocOnEnum(self): | 135 def testNoDocOnEnum(self): |
| 130 schema = self.idl_basics | 136 schema = self.idl_basics |
| 131 enum_with_nodoc = getType(schema, 'EnumTypeWithNoDoc') | 137 enum_with_nodoc = getType(schema, 'EnumTypeWithNoDoc') |
| 132 self.assertTrue(enum_with_nodoc is not None) | 138 self.assertTrue(enum_with_nodoc is not None) |
| 133 self.assertTrue(enum_with_nodoc['nodoc']) | 139 self.assertTrue(enum_with_nodoc['nodoc']) |
| 134 | 140 |
| 135 def testInternalNamespace(self): | 141 def testInternalNamespace(self): |
| 136 idl_basics = self.idl_basics | 142 idl_basics = self.idl_basics |
| 137 self.assertEquals('idl_basics', idl_basics['namespace']) | 143 self.assertEquals('idl_basics', idl_basics['namespace']) |
| 138 self.assertTrue(idl_basics['internal']) | 144 self.assertTrue(idl_basics['internal']) |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 ])), | 417 ])), |
| 412 ('fourth', OrderedDict([ | 418 ('fourth', OrderedDict([ |
| 413 ('description', 'Unvalued property.'), | 419 ('description', 'Unvalued property.'), |
| 414 ('type', 'integer'), | 420 ('type', 'integer'), |
| 415 ])), | 421 ])), |
| 416 ]), schema.get('properties')) | 422 ]), schema.get('properties')) |
| 417 | 423 |
| 418 | 424 |
| 419 if __name__ == '__main__': | 425 if __name__ == '__main__': |
| 420 unittest.main() | 426 unittest.main() |
| OLD | NEW |