OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 | 3 |
4 <script> | 4 <script> |
5 if (window.testRunner) | 5 if (window.testRunner) |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 | 7 |
8 var localImageLocation = "file:///tmp/LayoutTests/http/tests/security/resour
ces/compass.jpg"; | 8 var localImageLocation = "file:///tmp/LayoutTests/http/tests/security/resour
ces/compass.jpg"; |
9 if (window.testRunner) | 9 if (window.testRunner) |
10 localImageLocation = testRunner.pathToLocalResource(localImageLocation); | 10 localImageLocation = testRunner.pathToLocalResource(localImageLocation); |
11 | 11 |
12 var localImageElement = document.createElement("img"); | 12 var localImageElement = document.createElement("img"); |
13 localImageElement.setAttribute("id", "myImg"); | 13 localImageElement.setAttribute("id", "myImg"); |
14 localImageElement.setAttribute("src", localImageLocation); | 14 localImageElement.setAttribute("src", localImageLocation); |
15 | 15 |
16 function imageTest() { | 16 function imageTest() { |
17 document.body.appendChild(localImageElement); | 17 document.body.appendChild(localImageElement); |
18 | 18 |
19 var result = document.getElementById("result"); | 19 var result = document.getElementById("result"); |
20 var myImg = document.getElementById("myImg"); | 20 var myImg = document.getElementById("myImg"); |
21 | 21 |
22 if (myImg.naturalWidth == 0 && myImg.naturalHeight == 0) | 22 if (myImg.height == 0 && myImg.width == 0) |
23 result.innerHTML = "Test Passed. Local image not loaded remotely."; | 23 result.innerHTML = "Test Passed. Local image not loaded remotely."; |
24 else | 24 else |
25 result.innerHTML = "Test Failed: Local image loaded remotely."; | 25 result.innerHTML = "Test Failed: Local image loaded remotely."; |
26 } | 26 } |
27 </script> | 27 </script> |
28 | 28 |
29 </head> | 29 </head> |
30 <body onLoad="imageTest()"> | 30 <body onLoad="imageTest()"> |
31 <div id="div0"> | 31 <div id="div0"> |
32 This test is to see if a remote file can include a local image. | 32 This test is to see if a remote file can include a local image. |
33 <br/> | 33 <br/> |
34 Currently this test cannot be run manually on Windows because we do not
have | 34 Currently this test cannot be run manually on Windows because we do not
have |
35 a function like pathToLocalResource() outside of DRT. | 35 a function like pathToLocalResource() outside of DRT. |
36 <br/> | 36 <br/> |
37 </div> | 37 </div> |
38 </br> | 38 </br> |
39 <div id="result"> | 39 <div id="result"> |
40 Test has not run. | 40 Test has not run. |
41 </div> | 41 </div> |
42 </br> | 42 </br> |
43 </body> | 43 </body> |
44 </html> | 44 </html> |
OLD | NEW |