summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html
blob: 594eafdd1b9931473fe65bf554733c961e424bdf (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);
}

nick_load_count = 0

function nick_onload()
{
    log("NICK_ONLOAD called");
    ++nick_load_count;
    if (nick_load_count == 2) {
        log("SUCCESS.  Two loads.");
        layoutTestController.notifyDone();
    }
}

if (window.layoutTestController) {
    layoutTestController.waitUntilDone();
    layoutTestController.dumpAsText();
    layoutTestController.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.  See
bug 49236 in which this wasn't working.
<p>When this test succeeds, you'll see an image of Nick on a sailboat immediately below
this text.  When this test fails, you will see no images at all.
<link rel="prefetch" href="resources/nick.jpg" onload="nick_onload()" />
<img src="resources/nick.jpg" onload="nick_onload()" />
<hr>
<p><ol id="console"></ol></p>
</body></html>