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

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: 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 ee71016c77aedf53ea9927e07109a2a111d18320..62d49d1bc09c271cfa79a2c3f048c05b0b121d34 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.
@@ -616,5 +617,33 @@ class TestEditCode(TestCaseWithOutputDir):
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',
+ }
+ config = {
+ 'id': 'asaasdásdasdasddsadsad',
+ }
+
+ caterpillar.add_app_info(self.output_path, chrome_app_manifest, config)
+
+ 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 = {
Matt Giuca 2016/01/28 07:33:22 """\ Start on the next line.
Matthew Alger 2016/01/28 23:24:45 Done.
+ 'app': {
+ 'background': {}
+ },
+ 'name': 't\\u00e9st app'
+};
+chrome.caterpillar.appId = 'asaasdásdasdasddsadsad';
+""")
+
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « src/caterpillar.py ('k') | src/configuration.py » ('j') | src/configuration.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698