onload-completion-test.html revision abd0b16f66097fb5317221db993dafb6bd965965
1<!DOCTYPE html> 2<script text="text/javascript"> 3function runtest() 4{ 5var nick=document.getElementById('nick'); 6var row=document.getElementById('the_table').insertRow(-1); 7var result=row.insertCell(0); 8if (nick.naturalWidth == 320 && nick.naturalHeight == 240) 9 result.innerHTML = "SUCCESS."; 10else 11 result.innerHTML = "FAILURE!"; 12if (window.layoutTestController) 13 layoutTestController.dumpAsText(); 14} 15</script> 16<body onload="runtest()"> 17<p>This test verifies that at the time a body onload function is 18called that the subresources of this page (in particular the image) 19are already loaded. The page verifies that the image has the expected 20dimensions at the time of the onload event, and prints its result 21based on that. This is a regression test for a bug introduced by the 22patch for bug 3652.</p> 23<img id=nick src="resources/nick.jpg"> 24<table id="the_table" border="1"> 25<tr><td></td></tr> 26</table> 27</body> 28