| OLD | NEW |
| (Empty) |
| 1 description("This test checks to see if setting document.title works even if the
title element has multiple children."); | |
| 2 | |
| 3 // Setup - create title element. | |
| 4 shouldBe("document.getElementsByTagName('title').length", "0"); | |
| 5 var titleElement = document.createElement("title"); | |
| 6 document.body.appendChild(titleElement); | |
| 7 | |
| 8 // For case with no children. | |
| 9 shouldBe("document.title", "''"); | |
| 10 shouldBe("titleElement.text", "''"); | |
| 11 | |
| 12 // For case with single children. | |
| 13 var firstText = "First"; | |
| 14 titleElement.appendChild(document.createTextNode(firstText)); | |
| 15 shouldBe("document.title", "firstText"); | |
| 16 shouldBe("titleElement.text", "firstText"); | |
| 17 | |
| 18 // For case with 2 children. | |
| 19 var secondText = "Second"; | |
| 20 titleElement.appendChild(document.createTextNode(secondText)); | |
| 21 shouldBe("document.title", "firstText + secondText"); | |
| 22 shouldBe("titleElement.text", "firstText + secondText"); | |
| 23 | |
| 24 // override title with setting document.title with multiple title children. | |
| 25 var expected = "This title is set by property"; | |
| 26 document.title = expected; | |
| 27 shouldBe("document.title", "expected"); | |
| 28 shouldBe("titleElement.text", "expected"); | |
| OLD | NEW |