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

Unified Diff: tools/json_schema_compiler/cpp_type_generator_test.py

Issue 9447090: Allow comments in extension config files. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added minify to some files in tools/json_schema_compiler Created 8 years, 10 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 81ee04de136b0658b1cb618a7d4b130a1a0c96fe..80229470bfb959137dfcdb5722e77b2cd1e95af7 100644
--- a/tools/json_schema_compiler/cpp_type_generator_test.py
+++ b/tools/json_schema_compiler/cpp_type_generator_test.py
@@ -5,20 +5,33 @@
from cpp_type_generator import CppTypeGenerator
import json
import model
+import os
+import sys
import unittest
+# We need to get json_minify from the third_party directory.
+# This is similar to what is done in chrome/common/extensions/docs/build.py
+third_party_path = os.path.dirname(os.path.realpath(__file__)) + \
+ '/../../third_party/'
not at google - send to devlin 2012/03/02 02:15:08 ditto it would probably be nicer to pull all of t
+if third_party_path not in sys.path:
+ sys.path.insert(0, third_party_path)
+import json_minify as minify
+
class CppTypeGeneratorTest(unittest.TestCase):
def setUp(self):
self.model = model.Model()
- self.permissions_json = json.loads(open('test/permissions.json').read())
+ self.permissions_json = json.loads(minify.json_minify(
+ open('test/permissions.json').read()))
self.model.AddNamespace(self.permissions_json[0],
'path/to/permissions.json')
self.permissions = self.model.namespaces.get('permissions')
- self.windows_json = json.loads(open('test/windows.json').read())
+ self.windows_json = json.loads(minify.json_minify(
+ open('test/windows.json').read()))
self.model.AddNamespace(self.windows_json[0],
'path/to/window.json')
self.windows = self.model.namespaces.get('windows')
- self.tabs_json = json.loads(open('test/tabs.json').read())
+ self.tabs_json = json.loads(minify.json_minify(
+ open('test/tabs.json').read()))
self.model.AddNamespace(self.tabs_json[0],
'path/to/tabs.json')
self.tabs = self.model.namespaces.get('tabs')

Powered by Google App Engine
This is Rietveld 408576698