| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <body> | 2 <body> |
| 3 <div id=result></div> | 3 <div id=result></div> |
| 4 <script> | 4 <script> |
| 5 if (window.testRunner) | 5 if (window.testRunner) |
| 6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
| 7 | 7 |
| 8 if (window.internals) |
| 9 internals.settings.setTreatIPAddressAsDomain(true); |
| 10 |
| 8 function log(message) | 11 function log(message) |
| 9 { | 12 { |
| 10 document.getElementById("result").innerHTML += message + "<br>"; | 13 document.getElementById("result").innerHTML += message + "<br>"; |
| 11 } | 14 } |
| 12 | 15 |
| 13 document.domain = "0.0.1"; | 16 document.domain = "0.0.1"; |
| 14 | 17 |
| 15 try { | 18 try { |
| 16 new Worker("http://0.0.1/worker.js"); | 19 new Worker("http://0.0.1/worker.js"); |
| 17 log("FAIL: No exception thrown when accessing a worker from another domain."
); | 20 log("FAIL: No exception thrown when accessing a worker from another domain."
); |
| 18 } catch (error) { | 21 } catch (error) { |
| 19 if (error.code == 18) | 22 if (error.code == 18) |
| 20 log("PASS: Got security error."); | 23 log("PASS: Got security error."); |
| 21 else | 24 else |
| 22 log("FAIL: Got error code " + error.code + ". Expected error code 18."); | 25 log("FAIL: Got error code " + error.code + ". Expected error code 18."); |
| 23 } | 26 } |
| 24 | 27 |
| 25 try { | 28 try { |
| 26 new Worker("resources/non-existent.js"); | 29 new Worker("resources/non-existent.js"); |
| 27 log("PASS: No exception throw when accessing a same-origin URL after setting
document.domain."); | 30 log("PASS: No exception throw when accessing a same-origin URL after setting
document.domain."); |
| 28 } catch (error) { | 31 } catch (error) { |
| 29 log("FAIL: Got error code " + error.code + "."); | 32 log("FAIL: Got error code " + error.code + "."); |
| 30 } | 33 } |
| 31 | 34 |
| 32 </script> | 35 </script> |
| 33 </body> | 36 </body> |
| 34 </html> | 37 </html> |
| OLD | NEW |