blob: 5472cefd938b91d61996d78b49543e1f6da7b3e5 [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description('This tests that Text is constructable.');
shouldBe('new Text("one").data', '"one"');
shouldBe('new Text().data', '""');
shouldBe('new Text("two").ownerDocument', 'document');
shouldBe('typeof new Text', '"object"');
shouldBe('Object.prototype.toString.call(new Text)', '"[object Text]"');
shouldBeTrue('new Text instanceof Text');
shouldBe('Object.getPrototypeOf(new Text)', 'Text.prototype');
var frame = document.createElement('iframe');
document.body.appendChild(frame);
var innerWindow = frame.contentWindow;
var innerDocument = frame.contentDocument;
shouldBe('new innerWindow.Text("three").ownerDocument', 'innerDocument')
shouldBeTrue('new innerWindow.Text instanceof innerWindow.Text');
shouldBe('Object.getPrototypeOf(new innerWindow.Text)', 'innerWindow.Text.prototype');
</script>
<script src="../../../resources/js-test-post.js"></script>