| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 self.assertEquals(('This comment should appear in the documentation, ' | 219 self.assertEquals(('This comment should appear in the documentation, ' |
| 220 'despite occupying multiple lines.'), | 220 'despite occupying multiple lines.'), |
| 221 func['description']) | 221 func['description']) |
| 222 self.assertEquals( | 222 self.assertEquals( |
| 223 [{'description': ('So should this comment about the argument. ' | 223 [{'description': ('So should this comment about the argument. ' |
| 224 '<em>HTML</em> is fine too.'), | 224 '<em>HTML</em> is fine too.'), |
| 225 'name': 'arg', | 225 'name': 'arg', |
| 226 '$ref': 'MyType1'}], | 226 '$ref': 'MyType1'}], |
| 227 func['parameters']) | 227 func['parameters']) |
| 228 func = getFunction(schema, 'function4') | 228 func = getFunction(schema, 'function4') |
| 229 self.assertEquals(('This tests if "double-quotes" are escaped correctly.' | 229 self.assertEquals( |
| 230 '<br/><br/> It also tests a comment with two newlines.'), | 230 '<p>This tests if "double-quotes" are escaped correctly.</p>' |
| 231 func['description']) | 231 '<p>It also tests a comment with two newlines.</p>', |
| 232 func['description']) |
| 232 | 233 |
| 233 def testReservedWords(self): | 234 def testReservedWords(self): |
| 234 schema = idl_schema.Load('test/idl_reserved_words.idl')[0] | 235 schema = idl_schema.Load('test/idl_reserved_words.idl')[0] |
| 235 | 236 |
| 236 foo_type = getType(schema, 'Foo') | 237 foo_type = getType(schema, 'Foo') |
| 237 self.assertEquals([{'name': 'float'}, {'name': 'DOMString'}], | 238 self.assertEquals([{'name': 'float'}, {'name': 'DOMString'}], |
| 238 foo_type['enum']) | 239 foo_type['enum']) |
| 239 | 240 |
| 240 enum_type = getType(schema, 'enum') | 241 enum_type = getType(schema, 'enum') |
| 241 self.assertEquals([{'name': 'callback'}, {'name': 'namespace'}], | 242 self.assertEquals([{'name': 'callback'}, {'name': 'namespace'}], |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 {'type': 'string'} | 387 {'type': 'string'} |
| 387 ] | 388 ] |
| 388 }] | 389 }] |
| 389 }] | 390 }] |
| 390 | 391 |
| 391 self.assertEquals(expected, badabish_params) | 392 self.assertEquals(expected, badabish_params) |
| 392 | 393 |
| 393 | 394 |
| 394 if __name__ == '__main__': | 395 if __name__ == '__main__': |
| 395 unittest.main() | 396 unittest.main() |
| OLD | NEW |