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> |