2010-11-29 Gavin Peters <gavinp@chromium.org>
[WebKit-https.git] / LayoutTests / loader / reload-subresource-when-type-changes.html
1 <div id="logDiv">FAILED</div>
2 <script>
3 if (window.layoutTestController)
4     layoutTestController.dumpAsText();
5
6 var logDiv = document.getElementById("logDiv");
7
8 function clearLog()
9 {
10     logDiv.innerHTML = "";
11 }
12
13 function log(string)
14 {
15     logDiv.appendChild(document.createTextNode(string));
16     logDiv.appendChild(document.createElement("br"));
17 }
18
19 function checkLoadedImage(event, testNumber) {
20     var imageWidth = event.target.width;
21     if (imageWidth == 25)
22         log("PASS " + testNumber + " of 3");
23     else
24         log("IMAGE SIZE " + imageWidth + " FAIL - " + testNumber + " of 2");
25 }
26 </script>
27
28 <img src="resources/reload-subresource-when-type-changes.js">
29 <script src="resources/reload-subresource-when-type-changes.js"></script>
30
31 <link rel="prefetch" href="resources/image1.png">
32 <img src="resources/image1.png" onerror="log('LOAD ERROR - FAIL 2 of 3)" onload="checkLoadedImage(event, 2)">
33
34 <script src="resources/image2.png"></script>
35 <img src="resources/image2.png" onerror="log('LOAD ERROR - FAIL 2 of 3)" onload="checkLoadedImage(event, 3)">