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..e7978e5bbb42f760809f4436170c41c19c2b804f 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,34 @@ 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'); |
Mike West
2016/06/16 09:23:13
Nit: Can you add a newline between tests? Also abo
Peng Xinchao
2016/06/17 11:09:52
Done.
|
+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> |