diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html new file mode 100644 index 0000000000..cfbca35bfd --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_pushstate_url.html @@ -0,0 +1,24 @@ +<!doctype html> +<html> +<head> +<meta charset="utf-8"> +<title>History pushState sets the url</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<div id="log"></div> +<script> +async_test(function(t) { + var oldLocation = window.location.toString(); + window.history.pushState(null, "", "#hash"); + assert_equals(oldLocation + "#hash", window.location.toString(), "pushState updates url"); + history.back(); + window.onhashchange = () => { + assert_equals(oldLocation, window.location.toString(), 'history traversal restores old url'); + t.done(); + }; +}, "history pushState sets url"); +</script> +</body> +</html> |