Merge pull request #41 from mstriemer/precompile-1087653

Allow precompile in manifests
This commit is contained in:
Mark Striemer 2014-11-03 11:15:09 -06:00
Родитель d5434ce9f8 cf214c49bd
Коммит 2c8b3d4964
2 изменённых файлов: 14 добавлений и 1 удалений

Просмотреть файл

@ -123,7 +123,7 @@ class WebappSpec(Spec):
"orientation", "fullscreen", "appcache_path",
"type", "activities", "permissions", "csp",
"messages", "origin", "redirects",
"permissions", "chrome", "inputs", "role"],
"chrome", "inputs", "role", "precompile"],
"allowed_nodes": [],
"disallowed_nodes": ["widget"],
"child_nodes": {
@ -231,6 +231,9 @@ class WebappSpec(Spec):
},
"process": lambda s: s.process_permissions
},
"precompile": {
"expected_type": list,
},
"csp": {"expected_type": types.StringTypes,
"not_empty": True},
"messages": {

Просмотреть файл

@ -95,6 +95,10 @@ class WebappBaseTestCase(TestCase):
"orientation": "landscape",
"fullscreen": "true",
"type": "web",
"precompile": [
"game.js",
"database.js"
],
}
self.resources = [("app_type", "web")]
@ -1018,3 +1022,9 @@ class TestWebapps(WebappBaseTestCase):
self.data["chrome"] = []
self.analyze()
self.assert_failed(with_errors=True)
def test_precompile_wrong_format(self):
# "precompile" should be list of files not this weird dict.
self.data["precompile"] = {"foo.js": True}
self.analyze()
self.assert_failed(with_errors=True)