3 <script src=
"../../../resources/js-test.js"></script>
6 description('This tests that Text is constructable.');
8 shouldBe('new Text("one").data', '"one"');
9 shouldBe('new Text().data', '""');
10 shouldBe('new Text(undefined).data', '""');
11 shouldBe('new Text(null).data', '"null"');
12 shouldBe('new Text("two").ownerDocument', 'document');
14 shouldBe('typeof new Text', '"object"');
15 shouldBe('Object.prototype.toString.call(new Text)', '"[object Text]"');
16 shouldBeTrue('new Text instanceof Text');
17 shouldBe('Object.getPrototypeOf(new Text)', 'Text.prototype');
19 var frame
= document
.createElement('iframe');
20 document
.body
.appendChild(frame
);
21 var innerWindow
= frame
.contentWindow
;
22 var innerDocument
= frame
.contentDocument
;
24 shouldBe('new innerWindow.Text("three").ownerDocument', 'innerDocument')
25 shouldBeTrue('new innerWindow.Text instanceof innerWindow.Text');
26 shouldBe('Object.getPrototypeOf(new innerWindow.Text)', 'innerWindow.Text.prototype');