blob: 2968214e2e7a781c5b3285a5d7fb0d59ab5746fe [file] [log] [blame]
<!DOCTYPE html>
<head>
</head>
<body>
<script src="/js-test-resources/js-test.js"></script>
<script>
window.jsTestIsAsync = true;
description("The test passes if 'window.onerror' is invoked with unsanitized information on a script loaded with a 'crossorigin' attribute, but loads from same-origin and without valid CORS headers.");
window.onerror = function(msg, url, line, column, error) {
window.msg = msg;
window.url = url;
window.line = line;
window.column = column;
window.errorObject = error;
shouldBeTrue("/SomeError/.test(msg)");
shouldBeEqualToString("url", "http://127.0.0.1:8000/security/resources/cors-script.php?fail=true&cors=false");
shouldBe("line", "1");
shouldBe("column", "1");
shouldNotBe("window.errorObject", "null");
finishJSTest();
}
</script>
<script crossorigin="anonymous" src="resources/cors-script.php?fail=true&cors=false"></script>
</body>
</html>