Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.php

Issue 2060093002: Allow 'history.pushState' to modify query string for unique and file origins. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow 'history.pushState' to modify query string for unique and file origins. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <?php 1 <?php
2 header("Content-Security-Policy: sandbox allow-scripts"); 2 header("Content-Security-Policy: sandbox allow-scripts");
3 ?> 3 ?>
4 <script src="../resources/testharness.js"></script> 4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 5 <script src="../resources/testharnessreport.js"></script>
6 <script> 6 <script>
7 var orginURL = document.URL;
7 test(function () { 8 test(function () {
8 assert_throws('SecurityError', function () { 9 assert_throws('SecurityError', function () {
9 history.pushState(null, null, document.URL + "/path"); 10 history.pushState(null, null, orginURL + "/path");
10 }); 11 });
11 }, 'pushState to a new path in unique origin should fail with SecurityError'); 12 }, 'pushState to a new path in unique origin should fail with SecurityError');
13
12 test(function () { 14 test(function () {
13 try { 15 try {
14 history.pushState(null, null, document.URL + "#hash"); 16 history.pushState(null, null, orginURL + "#hash");
15 done(); 17 done();
16 } catch (e) { 18 } catch (e) {
17 assert_unreached("pushState to a new hash should not fail."); 19 assert_unreached("pushState #hash should not fail.");
18 } 20 }
19 }, 'pushState to new hash in unique origin should not fail with SecurityError'); 21 }, 'pushState #hash in unique origin should not fail with SecurityError');
22
23 test(function () {
24 try {
25 history.pushState(null, null, orginURL + "?hash");
26 done();
27 } catch (e) {
28 assert_unreached("pushState ?hash should not fail.");
29 }
30 }, 'pushState ?hash in unique origin should not fail with SecurityError');
31
32 test(function () {
33 try {
34 history.pushState(null, null, orginURL + "?hash#base");
35 done();
36 } catch (e) {
37 assert_unreached("pushState ?hash#base should not fail.");
38 }
39 }, 'pushState ?hash#base in unique origin should not fail with SecurityError');
20 </script> 40 </script>
OLDNEW
« no previous file with comments | « AUTHORS ('k') | third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.php » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698