diff options
Diffstat (limited to 'dom/html/test/test_bug1292522_same_domain_with_different_port_number.html')
-rw-r--r-- | dom/html/test/test_bug1292522_same_domain_with_different_port_number.html | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dom/html/test/test_bug1292522_same_domain_with_different_port_number.html b/dom/html/test/test_bug1292522_same_domain_with_different_port_number.html new file mode 100644 index 000000000..0dec91558 --- /dev/null +++ b/dom/html/test/test_bug1292522_same_domain_with_different_port_number.html @@ -0,0 +1,43 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=1292522 +If we set domain using document.domain = "...", a page and iframe must be +treated as the same domain if they differ in port number, +e.g. test1.example.org:8000 and test2.example.org:80 are the same domain if +document.domain = "example.org". +--> +<head> + <title>Test for Bug 1292522</title> + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> + <body> + <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1292522">Mozilla Bug 1292522</a> + <p id="display"></p> + + <pre id="test"> + <script class="testbody" type="text/javascript"> + + if (navigator.platform.startsWith("Linux")) { + SimpleTest.expectAssertions(0, 1); + } + SimpleTest.waitForExplicitFinish(); + window.addEventListener("message", onMessageReceived, false); + + var page; + + function onMessageReceived(event) + { + is(event.data, "testiframe", "Must be able to access the variable," + + " because page and iframe are the " + + "same domain."); + page.close(); + SimpleTest.finish(); + } + + page = window.open("http://test1.example.org:8000/tests/dom/html/test/bug1292522_page.html"); + </script> + </pre> + </body> +</html> |