blob: 62b4236d90015398d47268e60d310f4053e80a76 [file] [log] [blame]
<html>
<head>
<script>
function log(message)
{
var paragraph = document.createElement("p");
paragraph.appendChild(document.createTextNode(message));
document.getElementById("console").appendChild(paragraph);
}
function expect(expected, actual)
{
var msg = "Expected " + expected + ", got " + actual + ": ";
if (expected == actual)
log(msg + "PASS");
else
log(msg + "FAIL");
}
function test()
{
if (window.testRunner)
window.testRunner.dumpAsText();
expect(0, document.getElementsByTagName('title').length);
document.title = 'Document title';
expect(1, document.getElementsByTagName('title').length);
}
</script>
</head>
<body>
<p>Test that setting document.title creates a title element and appends it to the documents head if one does not already exist, as
per <a href='http://whatwg.org/specs/web-apps/current-work/#the-title1'>http://whatwg.org/specs/web-apps/current-work/#the-title1</a>.</p>
<hr>
<div id='console'/>
<script>
test();
</script>
</body>
</html>