blob: 9c2e1a9714a8286df233e64fdf0483ea4798d552 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="img-src 'none'; style-src 'none'; script-src 'unsafe-inline'">
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<p>Tests that an inline stylesheet, in a user agent shadow tree, is allowed to load a background image when the page has CSP policy: <code>img-src 'none'</code>. This test PASSED if there are no console warning messages.</p>
<div id="shadow-host"></div>
<script>
function runTest()
{
if (!window.testRunner || !window.internals)
return;
var userAgentShadowRoot = internals.ensureUserAgentShadowRoot(document.getElementById("shadow-host"));
var style = document.createElement("style");
userAgentShadowRoot.appendChild(style);
style.textContent = "#test1 { background-image: url(../../resources/abe.png); }";
}
runTest();
</script>
</body>
</html>