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

Unified Diff: tools/json_schema_compiler/cpp_type_generator_test.py

Issue 437883002: Make the root_namespace argument to json_schema_compiler.gypi a string (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: un-escape %% for windows Created 6 years, 4 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
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 7782b234a4ccbc74d6ba71d9540d5dc575ab33b4..f3a760a2adcf5833aa3165bc87776e5231ae669a 100755
--- a/tools/json_schema_compiler/cpp_type_generator_test.py
+++ b/tools/json_schema_compiler/cpp_type_generator_test.py
@@ -58,15 +58,26 @@ class CppTypeGeneratorTest(unittest.TestCase):
self.assertEquals('', manager.GenerateIncludes().Render())
self.assertEquals('#include "path/to/tabs.h"',
manager.GenerateIncludes(include_soft=True).Render())
- self.assertEquals('namespace tabs {\n'
- 'struct Tab;\n'
- '}',
- manager.GenerateForwardDeclarations().Render())
+ self.assertEquals(
+ 'namespace tabs {\n'
+ 'struct Tab;\n'
+ '} // namespace tabs',
+ manager.GenerateForwardDeclarations('%(namespace)s').Render())
+ self.assertEquals(
+ 'namespace foo {\n'
+ 'namespace bar {\n'
+ 'namespace tabs {\n'
+ 'struct Tab;\n'
+ '} // namespace tabs\n'
+ '} // namespace bar\n'
+ '} // namespace foo',
+ manager.GenerateForwardDeclarations('foo::bar::%(namespace)s').Render())
manager = CppTypeGenerator(self.models.get('permissions'),
_FakeSchemaLoader(m))
self.assertEquals('', manager.GenerateIncludes().Render())
self.assertEquals('', manager.GenerateIncludes().Render())
- self.assertEquals('', manager.GenerateForwardDeclarations().Render())
+ self.assertEquals(
+ '', manager.GenerateForwardDeclarations('%(namespace)s').Render())
manager = CppTypeGenerator(self.models.get('content_settings'),
_FakeSchemaLoader(m))
self.assertEquals('', manager.GenerateIncludes().Render())
@@ -85,11 +96,8 @@ class CppTypeGeneratorTest(unittest.TestCase):
self.assertEquals('#include "path/to/browser_action.h"\n'
'#include "path/to/font_settings.h"',
manager.GenerateIncludes().Render())
- self.assertEquals('namespace browser_action {\n'
- '}\n'
- 'namespace font_settings {\n'
- '}',
- manager.GenerateForwardDeclarations().Render())
+ self.assertEquals(
+ '', manager.GenerateForwardDeclarations('%(namespace)s').Render())
def testGetCppTypeSimple(self):
manager = CppTypeGenerator(self.models.get('tabs'), _FakeSchemaLoader(None))

Powered by Google App Engine
This is Rietveld 408576698