mirror of
https://github.com/servo/servo.git
synced 2025-08-01 03:30:33 +01:00
Move content tests to src/test/content for consistency
This commit is contained in:
parent
2238d81b53
commit
6f76244377
60 changed files with 2 additions and 2 deletions
57
src/test/content/test_document_implementation.html
Normal file
57
src/test/content/test_document_implementation.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="harness.js"></script>
|
||||
<script>
|
||||
// test1: basic test
|
||||
{
|
||||
isnot(document.implementation, null, "test1-0, basic test");
|
||||
is_a(document.implementation, DOMImplementation, "test1-1, basic test");
|
||||
|
||||
var implementation = document.implementation;
|
||||
is(document.implementation, implementation, "test1-2, basic test");
|
||||
}
|
||||
|
||||
// test2: createDocumentType
|
||||
{
|
||||
is(document.doctype, null, "test2-0, createDocumentType");
|
||||
|
||||
var doctype = document.implementation.createDocumentType("html", null, null);
|
||||
is_a(doctype && doctype, DocumentType, "test2-1, createDocumentType");
|
||||
|
||||
doctype = document.implementation.createDocumentType("html:html", null, null);
|
||||
is_a(doctype && doctype, DocumentType, "test2-2, createDocumentType");
|
||||
}
|
||||
|
||||
// test3: createHTMLDocument
|
||||
{
|
||||
var htmldoc = document.implementation.createHTMLDocument("example title");
|
||||
isnot(htmldoc, null, "test3-0, createHTMLDocument");
|
||||
is_a(htmldoc, Document, "test3-1, createHTMLDocument");
|
||||
is(htmldoc.childNodes.length, 2, "test3-3, createHTMLDocument");
|
||||
|
||||
is_a(htmldoc.doctype && htmldoc.doctype, DocumentType, "test3-4, createHTMLDocument");
|
||||
is(htmldoc.doctype.name, "html", "test3-5, createHTMLDocument");
|
||||
|
||||
is_a(htmldoc.documentElement && htmldoc.documentElement, HTMLHtmlElement, "test3-6, createHTMLDocument");
|
||||
is(htmldoc.documentElement.childNodes.length, 2, "test3-7, createHTMLDocument");
|
||||
is(htmldoc.documentElement.tagName, "HTML", "test3-8, createHTMLDocument");
|
||||
|
||||
is_a(htmldoc.head && htmldoc.head, HTMLHeadElement, "test3-9, createHTMLDocument");
|
||||
is(htmldoc.head.tagName, "HEAD", "test3-10, createHTMLDocument");
|
||||
is(htmldoc.head, htmldoc.documentElement.childNodes[0], "test3-11, createHTMLDocument");
|
||||
is(htmldoc.head.childNodes.length, 1, "test3-12, createHTMLDocument");
|
||||
|
||||
is_a(htmldoc.head.childNodes[0], HTMLTitleElement, "test3-13, createHTMLDocument");
|
||||
is(htmldoc.head.childNodes[0].tagName, "TITLE", "test3-14, createHTMLDocument");
|
||||
is(htmldoc.title, "example title", "test3-15, createHTMLDocument");
|
||||
|
||||
is_a(htmldoc.body && htmldoc.body, HTMLBodyElement, "test3-16, createHTMLDocument");
|
||||
is(htmldoc.body.tagName, "BODY", "test3-17, createHTMLDocument");
|
||||
is(htmldoc.body, htmldoc.documentElement.childNodes[1], "test3-18, createHTMLDocument");
|
||||
is(htmldoc.body.childNodes.length, 0, "test3-19, createHTMLDocument");
|
||||
}
|
||||
|
||||
finish();
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue