Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html

Issue 22880019: [DOM4] Doctypes now always have a node document and can be moved across document boundaries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improve tests Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html
diff --git a/LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html b/LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html
index e0e7e6795d7a891fb243760f4207c63517f5c85d..3fd85d77cd4b14ae27e47151042c1ff74ced909b 100644
--- a/LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html
+++ b/LayoutTests/fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html
@@ -1,17 +1,18 @@
<!doctype html>
-<title>document.implementation.createDocument with current document's DOCTYPE</title>
+<html>
+<head>
+<script src="../../../js/resources/js-test-pre.js"></script>
+</head>
<body>
-FAIL (Script did not run);
<script>
-document.body.textContent = "FAIL";
-try {
- document.implementation.createDocument(null, null, document.doctype);
- document.body.textContent = "FAIL (no exception)";
-}
-catch(e) {
- if (e.code === DOMException.WRONG_DOCUMENT_ERR || e.code === DOMException.NOT_SUPPORTED_ERR)
- document.body.textContent = "PASS";
- else
- document.body.textContent = "FAIL (wrong exception: " + e.code + ")";
-}
+description("document.implementation.createDocument with current document's DOCTYPE.")
+
+var doctype = document.doctype;
+var doc;
+shouldNotThrow("doc = document.implementation.createDocument(null, null, document.doctype)");
+shouldBe('doc.doctype', 'doctype');
+shouldBe('doc.firstChild', 'doctype');
+shouldBe('document.doctype', 'null');
</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698