diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html new file mode 100644 index 0000000000..2b2c308526 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/history/the-history-interface/history_properties_only_fully_active.html @@ -0,0 +1,23 @@ +<!doctype html> +<title>history properties should throw SecurityError when not in a fully active Document</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> + <iframe id="child"></iframe> +</body> +<script> + test(function(t) { + var ifr = document.getElementById("child"); + var cached_history = ifr.contentWindow.history; + var cached_DOMException = ifr.contentWindow.DOMException; + ifr.remove(); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.length; }); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.scrollRestoration; }); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.state; }); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.go(0); }); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.back(); }); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.forward(); }); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.pushState(1, document.title, "?x=1"); }); + assert_throws_dom("SecurityError", cached_DOMException, function() { cached_history.replaceState(2, document.title, "?x=2"); }); + }); +</script> |