| <p> |
| Test for <i><a href="rdar://problem/6074587">rdar://problem/6074587</a> |
| REGRESSION (34722): Unable to view AT&T wireless bill - window title contains markup, window is empty</i>. |
| </p> |
| <pre id="console"></pre> |
| <script> |
| if (window.layoutTestController) |
| layoutTestController.dumpAsText(); |
| |
| function log(message) |
| { |
| document.getElementById("console").appendChild(document.createTextNode(message + "\n")); |
| } |
| |
| function testTitle(text, expected) |
| { |
| var doc = document.implementation.createHTMLDocument(); |
| doc.open(); |
| doc.write("<title>" + text + "</title>text</title>"); |
| |
| var actual = doc.getElementsByTagName("title")[0].firstChild.data; |
| if (actual == expected) |
| log("PASS: " + text + " parsed correctly"); |
| else |
| log("FAIL: " + text + " parsed into " + actual + " instead of " + expected); |
| } |
| |
| testTitle("foo</title>bar", "foo</title>bar"); |
| testTitle("foo&", "foo&"); |
| testTitle("foo&bar", "foo&bar"); |
| |
| testTitle("</title>bar", "</title>bar"); |
| testTitle("&", "&"); |
| testTitle("&bar", "&bar"); |
| </script> |