Index: third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.php |
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.php b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.php |
index 612162a6d683e4b6f9eb9ffaa2eb3af27af84029..164d9f622246be6e12e97b18d74efe663d638aa9 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.php |
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-unique-origin-denied.php |
@@ -4,22 +4,41 @@ 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 () { |
testRunner.addOriginAccessWhitelistEntry(location.origin, location.protocol, '', false); |
}, 'testRunner.addOriginAccessWhitelistEntry is required for this test'); |
test(function () { |
assert_throws('SecurityError', function () { |
- history.pushState(null, null, document.URL + "/path"); |
+ history.pushState(null, null, orginURL + "/path"); |
}); |
}, 'pushState at unique origin should fail with SecurityError (even with whitelisted origins)'); |
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> |