summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html
blob: 07ced9eb020a6d9327f3d24f542f147d86629458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<html>
<head>
<script src="../../js/resources/js-test-pre.js"></script>
<script type="text/javascript">
function done()
{
    testPassed('onerror was called');
    if (window.layoutTestController)
        layoutTestController.notifyDone();
}
if (window.layoutTestController) {
    layoutTestController.dumpAsText();
    layoutTestController.waitUntilDone();
}
</script>
</head>
<body>
<p>This tests that onerror events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onerror/onload event is their only programatic side-effect.</p>
<p>If it works you should see a message below saying the test has passed.</p>
<link href="prefetch-noexisty.link" rel="prefetch" onload="testFailed('onload event should not occur')" onerror="done()">
<hr>
<div id="console"></div>
</body>
</html>