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 testRunner.addOriginAccessWhitelistEntry(location.origin, location.protocol,
'', false); | 6 testRunner.addOriginAccessWhitelistEntry(location.origin, location.protocol,
'', false); |
7 }, 'testRunner.addOriginAccessWhitelistEntry is required for this test'); | 7 }, 'testRunner.addOriginAccessWhitelistEntry is required for this test'); |
8 | 8 |
9 test(function () { | 9 test(function () { |
10 assert_throws('SecurityError', function () { | 10 assert_throws('SecurityError', function () { |
11 history.pushState(null, null, document.URL); | 11 history.pushState(null, null, document.URL + "/path"); |
12 }); | 12 }); |
13 }, 'pushState at unique origin should fail with SecurityError (even with whiteli
sted origins)'); | 13 }, 'pushState at unique origin should fail with SecurityError (even with whiteli
sted origins)'); |
| 14 |
| 15 test(function () { |
| 16 try { |
| 17 history.pushState(null, null, document.URL + "#hash"); |
| 18 done(); |
| 19 } catch (e) { |
| 20 assert_unreached("pushState to a new hash should not fail."); |
| 21 } |
| 22 }, 'pushState to new hash in unique origin should not fail with SecurityError'); |
14 </script> | 23 </script> |
OLD | NEW |