blob: aa4f15695307e6de3050e482e9ed6ba3240899e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<!DOCTYPE html>
<html>
<head>
<title>Object inside SVG foreignobject respect csp</title>
<meta http-equiv="Content-Security-Policy" content="object-src 'none'">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
async_test(function(t) {
document.addEventListener("securitypolicyviolation", t.step_func(function(e) {
if (e.blockedURI != "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/media/flash.swf")
return;
assert_equals(e.violatedDirective, "object-src");
t.done();
}));
}, "Should throw a securitypolicyviolation");
</script>
</head>
<body>
<svg>
<foreignObject>
<embed type="application/x-shockwave-flash" src="/content-security-policy/support/media/flash.swf">
</foreignObject>
</svg>
</body>
</html>
|