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

Unified Diff: tools/json_schema_compiler/idl_schema_test.py

Issue 11565053: Allow leading underscore on identifier names in IDL parser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added test file that I forgot in first patchset Created 8 years 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_lexer.py ('k') | tools/json_schema_compiler/test/idl_reserved_words.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 a71032346133d6078874c9e91c46c68f0faca00c..a4fd0d859aca3e1c490b3bfeecde0a27effe3343 100755
--- a/tools/json_schema_compiler/idl_schema_test.py
+++ b/tools/json_schema_compiler/idl_schema_test.py
@@ -121,5 +121,24 @@ class IdlSchemaTest(unittest.TestCase):
'<br/><br/> It also tests a comment with two newlines.'),
func['description'])
+ def testReservedWords(self):
+ schema = idl_schema.Load('test/idl_reserved_words.idl')[0]
+
+ foo_type = getType(schema, 'reserved_words.Foo')
+ self.assertEquals(['float', 'DOMString'], foo_type['enum'])
+
+ enum_type = getType(schema, 'reserved_words.enum')
+ self.assertEquals(['callback', 'namespace'], enum_type['enum'])
+
+ dictionary = getType(schema, 'reserved_words.dictionary');
+ self.assertEquals('integer', dictionary['properties']['long']['type'])
+
+ mytype = getType(schema, 'reserved_words.MyType')
+ self.assertEquals('string', mytype['properties']['interface']['type'])
+
+ params = getParams(schema, 'static')
+ self.assertEquals('reserved_words.Foo', params[0]['$ref'])
+ self.assertEquals('reserved_words.enum', params[1]['$ref'])
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « ppapi/generators/idl_lexer.py ('k') | tools/json_schema_compiler/test/idl_reserved_words.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698