| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script> | 3 <script> |
| 4 var secretness = 0; | 4 var secretness = 0; |
| 5 | 5 |
| 6 function test() { | 6 function test() { |
| 7 if (window.testRunner) | 7 if (window.testRunner) { |
| 8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
| 9 testRunner.waitUntilDone(); |
| 10 } |
| 9 | 11 |
| 10 var localScriptLocation = "file:///tmp/LayoutTests/http/tests/securi
ty/resources/localScript.js"; | 12 var localScriptLocation = "file:///tmp/LayoutTests/http/tests/securi
ty/resources/localScript.js"; |
| 11 if (window.testRunner) | 13 if (window.testRunner) |
| 12 localScriptLocation = testRunner.pathToLocalResource(localScript
Location); | 14 localScriptLocation = testRunner.pathToLocalResource(localScript
Location); |
| 13 | 15 |
| 14 var localScriptElement = document.createElement("script"); | 16 var localScriptElement = document.createElement("script"); |
| 15 localScriptElement.setAttribute("src", localScriptLocation); | 17 localScriptElement.setAttribute("src", localScriptLocation); |
| 16 localScriptElement.addEventListener("load", function() { | 18 localScriptElement.addEventListener("load", function() { |
| 17 var tag = document.getElementById("result"); | 19 var tag = document.getElementById("result"); |
| 18 if (secretness == 13) | 20 if (secretness == 13) |
| 19 tag.innerHTML = "Test Failed. Local script loaded and run."; | 21 tag.innerHTML = "Test Failed. Local script loaded and run."; |
| 20 else | 22 else |
| 21 tag.innerHTML = "Test Failed. Local script loaded, but not s
uccessfully run."; | 23 tag.innerHTML = "Test Failed. Local script loaded, but not s
uccessfully run."; |
| 24 |
| 25 if (window.testRunner) |
| 26 testRunner.notifyDone(); |
| 22 }); | 27 }); |
| 23 | 28 |
| 24 localScriptElement.addEventListener("error", function() { | 29 localScriptElement.addEventListener("error", function() { |
| 25 var tag = document.getElementById("result"); | 30 var tag = document.getElementById("result"); |
| 26 tag.innerHTML = "Test Passed: Local script not loaded."; | 31 tag.innerHTML = "Test Passed: Local script not loaded."; |
| 32 |
| 33 if (window.testRunner) |
| 34 testRunner.notifyDone(); |
| 27 }); | 35 }); |
| 28 | 36 |
| 29 document.body.appendChild(localScriptElement) | 37 document.body.appendChild(localScriptElement) |
| 30 } | 38 } |
| 31 </script> | 39 </script> |
| 32 </head> | 40 </head> |
| 33 <body onload="test()"> | 41 <body onload="test()"> |
| 34 <div id="div0"> | 42 <div id="div0"> |
| 35 This test is to see if a remote file can run a local script. | 43 This test is to see if a remote file can run a local script. |
| 36 <br/> | 44 <br/> |
| 37 Currently this test cannot be run manually on Windows because we do not
have | 45 Currently this test cannot be run manually on Windows because we do not
have |
| 38 a function like pathToLocalResource() outside of DRT. | 46 a function like pathToLocalResource() outside of DRT. |
| 39 <br/> | 47 <br/> |
| 40 </div> | 48 </div> |
| 41 <br> | 49 <br> |
| 42 <div id="result"> | 50 <div id="result"> |
| 43 Test not run correctly. | 51 Test not run correctly. |
| 44 </div> | 52 </div> |
| 45 </body> | 53 </body> |
| 46 </html> | 54 </html> |
| OLD | NEW |