blob: 779c6a919c5fac07173eb995e7da6faf2aa8c5ef [file] [log] [blame]
<!DOCTYPE html>
<head>
<title>SRI on cross origin CORS enabled style, with bad integrity</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
setup({single_test: true});
function styleLoad() {
assert_unreached("Style loaded.");
}
function styleError() {
assert_true(true, "Style did not load.");
}
</script>
<style>.id1 { background-color: red }</style>
<link rel="stylesheet"
onload="styleLoad()"
onerror="styleError();"
crossorigin
integrity="sha256-deadbeef"
href="http://localhost:8000/security/resources/cors-style.php"></link>
</head>
<body>
<script>
window.onload = function () {
var ele = document.getElementById('id1');
var divBackground = window.getComputedStyle(ele, null).getPropertyValue('background-color');
assert_equals(divBackground, "rgb(255, 0, 0)", "Style loaded.");
done();
};
</script>
<div id="id1" class="id1"></div>
</body>
</html>