blob: 0404a6b2e028bc8497b80c3ec7b510ed59740080 [file] [log] [blame]
<!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;
ifr.remove();
assert_throws("SecurityError", function() { cached_history.length; });
assert_throws("SecurityError", function() { cached_history.scrollRestoration; });
assert_throws("SecurityError", function() { cached_history.state; });
assert_throws("SecurityError", function() { cached_history.go(0); });
assert_throws("SecurityError", function() { cached_history.back(); });
assert_throws("SecurityError", function() { cached_history.forward(); });
assert_throws("SecurityError", function() { cached_history.pushState(1, document.title, "?x=1"); });
assert_throws("SecurityError", function() { cached_history.replaceState(2, document.title, "?x=2"); });
});
</script>