blob: 8daf02701039f0db14933e09cca8376f73d4d837 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../../resources/js-test-pre.js"></script>
<iframe src="http://localhost:8000/security/resources/iframe-with-element.html"></iframe>
<script>
description("Test the behavior of Object.preventExtensions() for Window / Location.");
jsTestIsAsync = true;
onload = function() {
debug ("* Cross origin");
shouldBeTrue("Object.isExtensible(frames[0])");
shouldThrowErrorName("Object.preventExtensions(frames[0])", "TypeError");
shouldBeTrue("Object.isExtensible(frames[0])");
shouldBeTrue("Object.isExtensible(frames[0].location)");
shouldThrowErrorName("Object.preventExtensions(frames[0].location)", "TypeError");
shouldBeTrue("Object.isExtensible(frames[0].location)");
debug("");
debug("* Same origin");
shouldBeTrue("Object.isExtensible(window)");
shouldThrowErrorName("Object.preventExtensions(window)", "TypeError");
shouldBeTrue("Object.isExtensible(window)");
shouldBeTrue("Object.isExtensible(window.location)");
shouldThrowErrorName("Object.preventExtensions(window.location)", "TypeError");
shouldBeTrue("Object.isExtensible(window.location)");
finishJSTest();
};
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>