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