chromium/third_party/blink/web_tests/fast/dom/HTMLLinkElement/programmatically-add-link-with-onerror-handler.html

<!DOCTYPE html>
<html>
<head>
<script src="resources/link-load-utilities.js"></script>
</head>
<body>
<p>This tests that a Load event is fired at a programmatically inserted HTML Link element whose @import style sheet failed to load. This test PASSED if you see the word PASS below. Otherwise, it FAILED.</p>
<pre id="console"></pre>
<script>
var link = createLinkElementWithStylesheet("resources/non-existent-stylesheet.css");
link.onload = function () { testFailedAndNotifyDone('Fired Load event. Should have fired Error event.') };
link.onerror = function () { testPassedAndNotifyDone('Fired Error event.') };
document.head.appendChild(link);
</script>
</body>
</html>