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

Unified Diff: tools/json_schema_compiler/cpp_type_generator_test.py

Issue 10022005: Let json schema compiler handle using arrays as types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor style changes Created 8 years, 8 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
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('k') | tools/json_schema_compiler/cpp_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cpp_type_generator_test.py
diff --git a/tools/json_schema_compiler/cpp_type_generator_test.py b/tools/json_schema_compiler/cpp_type_generator_test.py
index 46d50347b9182468467e26dc4a517ee543d4e378..4770fe3cdce78dd52d4ba5d505373f572fcd2600 100755
--- a/tools/json_schema_compiler/cpp_type_generator_test.py
+++ b/tools/json_schema_compiler/cpp_type_generator_test.py
@@ -23,6 +23,10 @@ class CppTypeGeneratorTest(unittest.TestCase):
self.model.AddNamespace(self.tabs_json[0],
'path/to/tabs.json')
self.tabs = self.model.namespaces.get('tabs')
+ self.browser_action_json = CachedLoad('test/browserAction.json')
+ self.model.AddNamespace(self.browser_action_json[0],
+ 'path/to/browserAction.json')
+ self.browser_action = self.model.namespaces.get('browserAction')
def testGenerateIncludesAndForwardDeclarations(self):
manager = CppTypeGenerator('', self.windows, self.windows.unix_name)
@@ -89,6 +93,13 @@ class CppTypeGeneratorTest(unittest.TestCase):
manager.GetType(
self.tabs.types['Tab'].properties['selected']))
+ def testArrayAsType(self):
+ manager = CppTypeGenerator('', self.browser_action,
+ self.browser_action.unix_name)
+ self.assertEquals('std::vector<int>',
+ manager.GetType(
+ self.browser_action.types['ColorArray']))
+
def testGetTypeArray(self):
manager = CppTypeGenerator('', self.windows, self.windows.unix_name)
self.assertEquals('std::vector<linked_ptr<Window> >',
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('k') | tools/json_schema_compiler/cpp_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698