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

Unified Diff: tools/json_schema_compiler/cpp_type_generator_test.py

Issue 10639020: Switch the downloads API over to IDL/json_schema_compiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 5 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/h_generator.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 b22c430274409daa7a20c93fa5c57af6553249b3..7c74fad5470baf5c44a1d43c0fa466a94b9ad732 100755
--- a/tools/json_schema_compiler/cpp_type_generator_test.py
+++ b/tools/json_schema_compiler/cpp_type_generator_test.py
@@ -59,12 +59,14 @@ class CppTypeGeneratorTest(unittest.TestCase):
def testGenerateIncludesAndForwardDeclarationsMultipleTypes(self):
m = model.Model()
self.tabs_json[0]['types'].append(self.permissions_json[0]['types'][0])
- tabs_namespace = m.AddNamespace(self.tabs_json[0],
- 'path/to/tabs.json')
self.windows_json[0]['functions'].append(
self.permissions_json[0]['functions'][1])
+ # Insert 'windows' before 'tabs' in order to test that they are sorted
+ # properly.
windows = m.AddNamespace(self.windows_json[0],
'path/to/windows.json')
+ tabs_namespace = m.AddNamespace(self.tabs_json[0],
+ 'path/to/tabs.json')
manager = CppTypeGenerator('', windows, self.windows.unix_name)
manager.AddNamespace(tabs_namespace, self.tabs.unix_name)
self.assertEquals('#include "path/to/tabs.h"',
@@ -81,16 +83,18 @@ class CppTypeGeneratorTest(unittest.TestCase):
def testGenerateIncludesAndForwardDeclarationsDependencies(self):
m = model.Model()
- browser_action_namespace = m.AddNamespace(self.browser_action_json[0],
- 'path/to/browser_action.json')
+ # Insert 'font_settings' before 'browser_action' in order to test that
+ # CppTypeGenerator sorts them properly.
font_settings_namespace = m.AddNamespace(self.font_settings_json[0],
'path/to/font_settings.json')
+ browser_action_namespace = m.AddNamespace(self.browser_action_json[0],
+ 'path/to/browser_action.json')
manager = CppTypeGenerator('', self.dependency_tester,
self.dependency_tester.unix_name)
- manager.AddNamespace(browser_action_namespace,
- self.browser_action.unix_name)
manager.AddNamespace(font_settings_namespace,
self.font_settings.unix_name)
+ manager.AddNamespace(browser_action_namespace,
+ self.browser_action.unix_name)
self.assertEquals('#include "path/to/browser_action.h"\n'
'#include "path/to/font_settings.h"',
manager.GenerateIncludes().Render())
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('k') | tools/json_schema_compiler/h_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698