blob: 69056f81eab557d86b5ce3947d91cf6d701ae412 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<iframe src="http://localhost:8080/"></iframe>
<script src="/js-test-resources/js-test.js"></script>
<script>
description("Cross-origin access to 'window.open' and 'window.opener' should throw a SecurityError.");
window.jsTestIsAsync = true;
var frame = document.querySelector('iframe');
window.onload = function () {
shouldThrow("frame.contentWindow.open()", '"SecurityError: Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."');
shouldThrow("frame.contentWindow.opener = 1;", '"SecurityError: Failed to set the \'opener\' property on \'Window\': Blocked a frame with origin \\"http://127.0.0.1:8000\\" from accessing a cross-origin frame."');
finishJSTest();
};
</script>
</body>
</html>