Index: LayoutTests/fast/dom/XMLSerializer-doctype2.html |
diff --git a/LayoutTests/fast/dom/XMLSerializer-doctype2.html b/LayoutTests/fast/dom/XMLSerializer-doctype2.html |
index 78da090c22a76f51424ac17ba4faa6907c4bcf1f..304b1053dbe8eb7819c54dbbe1e85022df59ebe5 100644 |
--- a/LayoutTests/fast/dom/XMLSerializer-doctype2.html |
+++ b/LayoutTests/fast/dom/XMLSerializer-doctype2.html |
@@ -1,37 +1,18 @@ |
<html> |
<head> |
- <script> |
- function debug(str) { |
- li = document.createElement('li'); |
- li.appendChild(document.createTextNode(str)); |
- document.getElementById('console').appendChild(li); |
- } |
- |
- function runTests() { |
- if (window.testRunner) |
- testRunner.dumpAsText(); |
- |
- var docType = window.document.implementation.createDocumentType("aDocTypeName", "aPublicID", "aSystemID"); |
- |
- var serializer = new XMLSerializer(); |
- |
- try { |
- var text = serializer.serializeToString(docType); |
- debug("FAIL: XMLSerializer.serializeToString() should throw an exception if it tries to serialize a documentless DocumentType node."); |
- } catch (e) { |
- if (e == "InvalidAccessError: A parameter or an operation was not supported by the underlying object.") |
- debug("PASS: an " + e + " was thrown as expected.") |
- else |
- debug("FAIL: XMLSerializer.serializeToString() should throw an InvalidAccessError DOMExeption if it tries to serialize a documentless DocumentType node."); |
- } |
- } |
- </script> |
+<script src="../js/resources/js-test-pre.js"></script> |
</head> |
-<body onload="runTests()"> |
-This tests XMLSerializer.serializeToString() on a DocumentType node that does not have a document associated |
-with it. It should throw an INVALID_ACCESS_ERR DOMException. |
+<body> |
+<script> |
+description("This tests XMLSerializer.serializeToString() on a newly created DocumentType node does not throw since the node has an associated document."); |
+ |
+var docType = window.document.implementation.createDocumentType("aDocTypeName", "aPublicID", "aSystemID"); |
+var serializer = new XMLSerializer(); |
-<ul id="console"> |
-</ul> |
+var text; |
+shouldNotThrow("text = serializer.serializeToString(docType)"); |
+shouldBeEqualToString("text", "<!DOCTYPE aDocTypeName PUBLIC \"aPublicID\" \"aSystemID\">"); |
+</script> |
+<script src="../js/resources/js-test-pre.js"></script> |
</body> |
</html> |