| OLD | NEW |
| (Empty) | |
| 1 <?php |
| 2 header("Suborigin: foo"); |
| 3 ?> |
| 4 <!DOCTYPE html> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <body> |
| 8 <a id="bar"></a> |
| 9 <script> |
| 10 window.onload = _ => { |
| 11 async_test(t => { |
| 12 history.pushState({"name": "value"}, "navigation", "foo.html"); |
| 13 history.pushState({"name": "value"}, "navigation", "bar.html"); |
| 14 assert_equals(window.location.href, "http://127.0.0.1:8000/security/subori
gins/bar.html"); |
| 15 |
| 16 window.addEventListener("popstate", t.step_func(e => { |
| 17 if (e.state) { |
| 18 assert_equals(window.location.href, "http://127.0.0.1:8000/security/su
borigins/foo.html"); |
| 19 assert_equals(e.state.name, "value"); |
| 20 t.done(); |
| 21 } |
| 22 })); |
| 23 |
| 24 history.back(); |
| 25 }, "History state manipulation is allowed in suborigins."); |
| 26 |
| 27 async_test(t => { |
| 28 var original = window.location.href; |
| 29 window.location.hash = "bar"; |
| 30 assert_equals(window.location.href, original + "#bar"); |
| 31 |
| 32 window.addEventListener("hashchange", t.step_func_done(e => { |
| 33 assert_equals(e.newURL, original + "#bar"); |
| 34 })); |
| 35 }, "Hash navigations are allowed in suborigins."); |
| 36 }; |
| 37 </script> |
| 38 </body> |
| OLD | NEW |