Add support for "csp" elements (bug 807304)

This commit is contained in:
Matt Basta 2012-11-05 16:50:48 -08:00
Родитель 281c869011
Коммит 814aa57c3e
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -39,7 +39,7 @@ class WebappSpec(Spec):
"default_locale", "installs_allowed_from",
"version", "screen_size", "required_features",
"orientation", "fullscreen", "appcache_path",
"type", "activities", "permissions"],
"type", "activities", "permissions", "csp"],
"allowed_nodes": ["developer"],
"disallowed_nodes": ["widget"],
"child_nodes": {
@ -143,7 +143,9 @@ class WebappSpec(Spec):
}
},
"process": lambda s: s.process_permissions
}
},
"csp": {"expected_type": types.StringTypes,
"not_empty": True},
}
}

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

@ -683,3 +683,8 @@ class TestWebapps(TestCase):
self.data["permissions"]["settings"]["access"] = "createonly"
self.analyze()
self.assert_failed(with_errors=True)
def test_csp(self):
self.data['csp'] = 'this is the csp policy. it can be a string.'
self.analyze()
self.assert_silent()