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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.php b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.php
index 629b65f05f916392579632bcc20428bfa9c48054..413ece65eff12cb70fe19bd6b02e55b1a03d8e5b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.php
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-at-unique-origin-denied.php
@@ -4,17 +4,37 @@ header("Content-Security-Policy: sandbox allow-scripts");
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
+var orginURL = document.URL;
test(function () {
assert_throws('SecurityError', function () {
- history.pushState(null, null, document.URL + "/path");
+ history.pushState(null, null, orginURL + "/path");
});
}, 'pushState to a new path in unique origin should fail with SecurityError');
+
test(function () {
try {
- history.pushState(null, null, document.URL + "#hash");
+ history.pushState(null, null, orginURL + "#hash");
done();
} catch (e) {
- assert_unreached("pushState to a new hash should not fail.");
+ assert_unreached("pushState #hash should not fail.");
}
-}, 'pushState to new hash in unique origin should not fail with SecurityError');
+}, 'pushState #hash in unique origin should not fail with SecurityError');
+
+test(function () {
+ try {
+ history.pushState(null, null, orginURL + "?hash");
+ done();
+ } catch (e) {
+ assert_unreached("pushState ?hash should not fail.");
+ }
+}, 'pushState ?hash in unique origin should not fail with SecurityError');
+
+test(function () {
+ try {
+ history.pushState(null, null, orginURL + "?hash#base");
+ done();
+ } catch (e) {
+ assert_unreached("pushState ?hash#base should not fail.");
+ }
+}, 'pushState ?hash#base in unique origin should not fail with SecurityError');
</script>
« 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