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

Unified Diff: src/caterpillar_test.py

Issue 1644913002: Caterpillar now generates app.info.js, a metadata script. Resolves #12. (Closed) Base URL: git@github.com:chromium/caterpillar.git@dependency-script-injection
Patch Set: Response to CR + whitespace fix Created 4 years, 11 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: src/caterpillar_test.py
diff --git a/src/caterpillar_test.py b/src/caterpillar_test.py
index 7ae50ff8e5beea0534d317deabb129782c30abbd..9ba0addbcd3ca0d4e422770504e31c00105d16e4 100755
--- a/src/caterpillar_test.py
+++ b/src/caterpillar_test.py
@@ -66,6 +66,7 @@ class TestCaseWithOutputDir(TestCaseWithTempDir):
caterpillar.setup_output_dir(MINIMAL_PATH, self.output_path,
BOILERPLATE_DIR)
+
# Test cases.
@@ -617,5 +618,30 @@ chrome.app.runtime.onLaunched.addListener(function() {
self.assertIn('<meta content="test233" name="name"', js_file.read())
+class TestAddAppInfo(TestCaseWithOutputDir):
+ """Tests add_app_info."""
+
+ def test_add_app_info(self):
+ """Tests add_app_info writes the correct file."""
+ chrome_app_manifest = {
+ 'app': {'background': {}},
+ 'name': 'tést app',
+ }
+
+ caterpillar.add_app_info(self.output_path, chrome_app_manifest)
+
+ with open(os.path.join(self.output_path, 'app.info.js')) as app_info_file:
+ app_info_js = app_info_file.read().decode('utf-8')
+
+ self.assertEqual(app_info_js, """\
+chrome.caterpillar.manifest = {
+ 'app': {
+ 'background': {}
+ },
+ 'name': 't\\u00e9st app'
+};
+""")
+
+
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698