Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / local-image-from-remote.html
blob675e1599b6f2939541155173998f441cd4840d2a
1 <html>
2 <head>
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 var localImageLocation = "file:///tmp/LayoutTests/http/tests/security/resources/compass.jpg";
9 if (window.testRunner)
10 localImageLocation = testRunner.pathToLocalResource(localImageLocation);
12 var localImageElement = document.createElement("img");
13 localImageElement.setAttribute("id", "myImg");
14 localImageElement.setAttribute("src", localImageLocation);
16 function imageTest() {
17 document.body.appendChild(localImageElement);
19 var result = document.getElementById("result");
20 var myImg = document.getElementById("myImg");
22 if (myImg.height == 0 && myImg.width == 0)
23 result.innerHTML = "Test Passed. Local image not loaded remotely.";
24 else
25 result.innerHTML = "Test Failed: Local image loaded remotely.";
27 </script>
29 </head>
30 <body onLoad="imageTest()">
31 <div id="div0">
32 This test is to see if a remote file can include a local image.
33 <br/>
34 Currently this test cannot be run manually on Windows because we do not have
35 a function like pathToLocalResource() outside of DRT.
36 <br/>
37 </div>
38 </br>
39 <div id="result">
40 Test has not run.
41 </div>
42 </br>
43 </body>
44 </html>