blob: 1f8005fa1d66737d2f7f77b63119a82424a3a969 [file] [log] [blame]
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<script>
description("Checks that passing invalid strings to window.open() is properly handled.");
if (window.testRunner)
testRunner.setCanOpenWindows();
var nonConvertibleToString = { toString: function() { throw "Exception in toString()"; } };
var newWindow = null;
shouldThrow("newWindow = window.open(nonConvertibleToString)", "'Exception in toString()'");
shouldBeNull("newWindow");
shouldThrow("newWindow = window.open('about:blank', nonConvertibleToString)", "'Exception in toString()'");
shouldBeNull("newWindow");
shouldThrow("newWindow = window.open('about:blank', 'frameName', nonConvertibleToString)", "'Exception in toString()'");
shouldBeNull("newWindow");
</script>
</body>
</html>