link-and-subresource-test.html revision abd0b16f66097fb5317221db993dafb6bd965965
1<html> 2<body> 3<script> 4function log(message) 5{ 6 var item = document.createElement("li"); 7 item.appendChild(document.createTextNode(message)); 8 document.getElementById("console").appendChild(item); 9} 10 11nick_load_count = 0 12 13function nick_onload() 14{ 15 log("NICK_ONLOAD called"); 16 ++nick_load_count; 17 if (nick_load_count == 2) { 18 log("SUCCESS. Two loads."); 19 layoutTestController.notifyDone(); 20 } 21} 22 23if (window.layoutTestController) { 24 layoutTestController.waitUntilDone(); 25 layoutTestController.dumpAsText(); 26 layoutTestController.dumpResourceResponseMIMETypes(); 27} 28</script> 29<p>This test verifies that an image which is prefetched, and which is also contained as a 30subresource of the current document can be loaded correctly as a subresource. See 31bug 49236 in which this wasn't working. 32<p>When this test succeeds, you'll see an image of Nick on a sailboat immediately below 33this text. When this test fails, you will see no images at all. 34<link rel="prefetch" href="resources/nick.jpg" onload="nick_onload()" /> 35<img src="resources/nick.jpg" onload="nick_onload()" /> 36<hr> 37<p><ol id="console"></ol></p> 38</body></html> 39 40