summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
blob: 874e993a2d1d7e8bc98ce35d614e50af76735b9e (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<html>
<body>
<script>
function log(message)
{
    var item = document.createElement("li");
    item.appendChild(document.createTextNode(message));
    document.getElementById("console").appendChild(item);
}

dne_error_count = 0

function dne_onerror()
{
    log("DNE_ONERROR called");
    ++dne_error_count;
    if (dne_error_count == 2) {
        log("SUCCESS.  Two errors.");
        testRunner.notifyDone();
    }
}

if (window.testRunner) {
    testRunner.waitUntilDone();
    testRunner.dumpAsText();
    testRunner.dumpResourceResponseMIMETypes();
}
</script>
<p>This test verifies that an image which is prefetched, and which is also contained as a
subresource of the current document can be loaded correctly as a subresource, even if the URI
doesn't exist.

<p>When this test succeeds, you will see nothing.  When this test fails, you will crash or have another error.
<link rel="prefetch" href="resources/does-not-exist.jpg" onerror="dne_onerror()" />
<img src="resources/does-not-exist.jpg" onerror="dne_onerror()" />
<hr>
<p><ol id="console"></ol></p>
</body></html>