6 var paragraph
= document
.createElement("p");
7 paragraph
.appendChild(document
.createTextNode(message
));
8 document
.getElementById("console").appendChild(paragraph
);
11 function expect(expected
, actual
)
13 var msg
= "Expected " + expected
+ ", got " + actual
+ ": ";
14 if (expected
== actual
)
22 if (window
.testRunner
)
23 window
.testRunner
.dumpAsText();
25 expect(0, document
.getElementsByTagName('title').length
);
26 document
.title
= 'Document title';
27 expect(1, document
.getElementsByTagName('title').length
);
32 <p>Test that setting document.title creates a title element and appends it to the documents head if one does not already exist, as
33 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>