Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLStyleElement / programmatically-add-style-with-onerror-handler.html
blobee140a8b9695bfded440882af517de897e411c71
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../HTMLLinkElement/resources/link-load-utilities.js"></script>
5 </head>
6 <body>
7 <p>This tests that an Error event is fired at a programmatically inserted HTML Style element whose @import style sheet failed to load. This test PASSED if you see the word PASS below. Otherwise, it FAILED.</p>
8 <pre id="console"></pre>
9 <script>
10 var style = createStyleElementWithString('@import "resources/non-existent-stylesheet.css";');
11 style.onload = function () { testFailedAndNotifyDone('Fired Load event. Should have fired Error event.') };
12 style.onerror = function () { testPassedAndNotifyDone('Fired Error event.') };
13 document.head.appendChild(style);
14 </script>
15 </body>
16 </html>