OLD | NEW |
1 <meta http-equiv="Content-Security-Policy" content="sandbox allow-scripts"> | 1 <meta http-equiv="Content-Security-Policy" content="sandbox allow-scripts"> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 <script> | 4 <script> |
5 test(function () { | 5 test(function () { |
6 assert_throws('SecurityError', function () { | 6 assert_throws('SecurityError', function () { |
7 history.pushState(null, null, document.URL); | 7 history.pushState(null, null, document.URL + "/path"); |
8 }); | 8 }); |
9 }, 'pushState at unique origin should fail with SecurityError'); | 9 }, 'pushState to a new path in unique origin should fail with SecurityError'); |
| 10 test(function () { |
| 11 try { |
| 12 history.pushState(null, null, document.URL + "#hash"); |
| 13 done(); |
| 14 } catch (e) { |
| 15 assert_unreached("pushState to a new hash should not fail."); |
| 16 } |
| 17 }, 'pushState to new hash in unique origin should not fail with SecurityError'); |
10 </script> | 18 </script> |
OLD | NEW |