diff options
Diffstat (limited to 'LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html')
-rw-r--r-- | LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html b/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html new file mode 100644 index 0000000..594eafd --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html @@ -0,0 +1,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> + |