| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test for Bug 33806: Would like API to disallow setting of document.do
main for pages with certain URL schemes</title> | 4 <title>Test for Bug 33806: Would like API to disallow setting of document.do
main for pages with certain URL schemes</title> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <p>Test for <a href="http://webkit.org/b/33806">Bug 33806: Would like API to
disallow setting of | 7 <p>Test for <a href="http://webkit.org/b/33806">Bug 33806: Would like API to
disallow setting of |
| 8 document.domain for pages with certain URL schemes</a>. If the test succeeds
, you will see a | 8 document.domain for pages with certain URL schemes</a>. If the test succeeds
, you will see a |
| 9 series of "PASS" messages below.</p> | 9 series of "PASS" messages below.</p> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 log("PASS: document.domain should be " + expected + " and is"); | 23 log("PASS: document.domain should be " + expected + " and is"); |
| 24 else | 24 else |
| 25 log("FAIL: document.domain should be " + expected + " but is " +
actual); | 25 log("FAIL: document.domain should be " + expected + " but is " +
actual); |
| 26 } | 26 } |
| 27 | 27 |
| 28 if (window.testRunner) | 28 if (window.testRunner) |
| 29 testRunner.dumpAsText(); | 29 testRunner.dumpAsText(); |
| 30 else | 30 else |
| 31 log("This test can be run meaningfully only in DumpRenderTree"); | 31 log("This test can be run meaningfully only in DumpRenderTree"); |
| 32 | 32 |
| 33 if (window.internals) |
| 34 internals.settings.setTreatIPAddressAsDomain(true); |
| 35 |
| 33 domainShouldBe("127.0.0.1"); | 36 domainShouldBe("127.0.0.1"); |
| 34 document.domain = "0.0.1"; | 37 document.domain = "0.0.1"; |
| 35 domainShouldBe("0.0.1"); | 38 domainShouldBe("0.0.1"); |
| 36 | 39 |
| 37 log("Forbidding domain relaxation for the http: scheme"); | 40 log("Forbidding domain relaxation for the http: scheme"); |
| 38 | 41 |
| 39 if (window.testRunner) | 42 if (window.testRunner) |
| 40 testRunner.setDomainRelaxationForbiddenForURLScheme(true, "http"); | 43 testRunner.setDomainRelaxationForbiddenForURLScheme(true, "http"); |
| 41 | 44 |
| 42 var exception; | 45 var exception; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 69 document.domain = "1"; | 72 document.domain = "1"; |
| 70 domainShouldBe("1"); | 73 domainShouldBe("1"); |
| 71 | 74 |
| 72 log("Allowing domain relaxation for the not-http: scheme"); | 75 log("Allowing domain relaxation for the not-http: scheme"); |
| 73 | 76 |
| 74 if (window.testRunner) | 77 if (window.testRunner) |
| 75 testRunner.setDomainRelaxationForbiddenForURLScheme(false, "not-http
"); | 78 testRunner.setDomainRelaxationForbiddenForURLScheme(false, "not-http
"); |
| 76 </script> | 79 </script> |
| 77 </body> | 80 </body> |
| 78 </html> | 81 </html> |
| OLD | NEW |