blob: 760e03a6a3b4340f520df266239f2c257d139036 [file] [log] [blame]
<!DOCTYPE html>
<title>This tests that Comment is constructable</title>
<body>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script>
setup({single_test: true});
assert_equals(new Comment("one").data, "one");
assert_equals(new Comment().data, "");
assert_equals(new Comment(undefined).data, "");
assert_equals(new Comment(null).data, "null");
assert_equals(new Comment("two").ownerDocument, document);
assert_equals(typeof new Comment, "object");
assert_equals(Object.prototype.toString.call(new Comment), "[object Comment]");
assert_true(new Comment instanceof Comment);
assert_equals(Object.getPrototypeOf(new Comment), Comment.prototype);
var frame = document.createElement('iframe');
document.body.appendChild(frame);
var innerWindow = frame.contentWindow;
var innerDocument = frame.contentDocument;
assert_equals(new innerWindow.Comment("three").ownerDocument, innerDocument);
assert_true(new innerWindow.Comment instanceof innerWindow.Comment);
assert_equals(Object.getPrototypeOf(new innerWindow.Comment), innerWindow.Comment.prototype);
done();
</script>