servo/tests/wpt/web-platform-tests/content-security-policy/object-src/object-src-no-url-blocked.sub.html

27 lines
973 B
HTML

<!DOCTYPE html>
<html>
<head>
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self';">
<title>object-src-no-url-blocked</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src='../support/logTest.sub.js?logs=["violated-directive=object-src"]'></script>
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
</head>
<body>
<p>This test passes if there is a CSP violation saying the plugin was blocked.</p>
<script>
window.addEventListener('securitypolicyviolation', function(e) {
log("violated-directive=" + e.violatedDirective);
});
</script>
<object type="application/x-webkit-test-netscape"></object>
<div id="log"></div>
</body>
</html>