2006-01-03 Anders Carlsson <andersca@mac.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jan 2006 10:06:36 +0000 (10:06 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Jan 2006 10:06:36 +0000 (10:06 +0000)
        Reviewed by Maciej.

        - Add test for http://bugzilla.opendarwin.org/show_bug.cgi?id=5378
        createDocument fails with DOM Exception 5 when passed empty qname

        * dom/html/level2/core/createDocument08-expected.txt:
        * dom/xhtml/level2/core/createDocument08-expected.txt:
        These now fail.

        * fast/dom/createDocument-empty-expected.txt: Added.
        * fast/dom/createDocument-empty.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@11856 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/dom/html/level2/core/createDocument08-expected.txt
LayoutTests/dom/xhtml/level2/core/createDocument08-expected.txt
LayoutTests/fast/dom/createDocument-empty-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/createDocument-empty.html [new file with mode: 0644]

index 095b7900086ada3ead5747b7f97cd117f8b23a8e..b58089d03c8b92986c2bd5ad14638fa67daaee36 100644 (file)
@@ -1,3 +1,17 @@
+2006-01-03  Anders Carlsson  <andersca@mac.com>
+
+        Reviewed by Maciej.
+
+        - Add test for http://bugzilla.opendarwin.org/show_bug.cgi?id=5378
+        createDocument fails with DOM Exception 5 when passed empty qname
+        
+        * dom/html/level2/core/createDocument08-expected.txt:
+        * dom/xhtml/level2/core/createDocument08-expected.txt:
+        These now fail.
+        
+        * fast/dom/createDocument-empty-expected.txt: Added.
+        * fast/dom/createDocument-empty.html: Added.
+
 2006-01-03  Anders Carlsson  <andersca@mac.com>
 
         Reviewed by Darin.
index 9eb9d1b418540bbc3dfb65a5f418a955c1fd2f66..8548903581f767d432e10cf6ae4812bad1f7c3c7 100644 (file)
@@ -1,2 +1,3 @@
-Test:  http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument08
-Status:        Success
+Test:  http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument08      
+Status:        failure
+Detail:        throw_INVALID_CHARACTER_ERR: assertTrue failed
index 0a2d395568df508901b6f0b08a3151a5447d4e33..5a33844b83578a8023b3492b5cbefd27658d9304 100644 (file)
@@ -1,3 +1,4 @@
 Test   http://www.w3.org/2001/DOM-Test-Suite/level2/core/createDocument08
-Status Success
+Status failure
+Message        throw_INVALID_CHARACTER_ERR: assertTrue failed
 
diff --git a/LayoutTests/fast/dom/createDocument-empty-expected.txt b/LayoutTests/fast/dom/createDocument-empty-expected.txt
new file mode 100644 (file)
index 0000000..ecf010f
--- /dev/null
@@ -0,0 +1,3 @@
+This tests that it should be possible to create documents with empty/null qnames and namespaceURIs. If the test is successful, 'SUCCESS' will be displayed below, otherwise 'FAILURE' and a reason will be displayed.
+SUCCESS!
+
diff --git a/LayoutTests/fast/dom/createDocument-empty.html b/LayoutTests/fast/dom/createDocument-empty.html
new file mode 100644 (file)
index 0000000..ab67b20
--- /dev/null
@@ -0,0 +1,93 @@
+<html>
+<head>
+<script>
+function debug(str) {
+    pre = document.getElementById('console');
+    txt = document.createTextNode(str)
+    pre.appendChild(txt)
+}
+function runTests() {
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var uri = 'http://www.example.org';
+
+    // Both null namespaceURI and qname
+    try {
+        var doc = document.implementation.createDocument(null, null, null)
+        
+        if (doc.documentElement) {
+            debug('FAILURE: Document created should not have a document element')
+            return;
+        }
+    } catch (e) {
+        debug('FAILURE: Got exception ' + e.message + ' when creating document with null namespaceURI and qualifiedName')
+        return;
+    }
+    
+    // Both empty namespaceURI and qname
+    try {
+        var doc = document.implementation.createDocument('', '', null)
+        
+        if (doc.documentElement) {
+            debug('FAILURE: Document created should not have a document element')
+            return;
+        }
+    } catch (e) {
+        debug('FAILURE: Got exception ' + e.message + ' when creating document with empty namespaceURI and qualifiedName')
+        return;
+    }
+
+    // Null namespaceURI with qname
+    try {
+        var doc = document.implementation.createDocument(null, 'test', null)
+        
+        if (!doc.documentElement) {
+            debug('FAILURE: Document created should have a document element')
+            return;
+        }
+        
+    } catch (e) {
+        debug('FAILURE: Got exception ' + e.message + ' when creating document with null namespaceURI')
+        return;
+    }
+    
+    // Empty namespaceURI with qname
+    try {
+        var doc = document.implementation.createDocument('', 'test', null)
+        
+        if (!doc.documentElement) {
+            debug('FAILURE: Document created should have a document element')
+            return;
+        }
+        
+    } catch (e) {
+        debug('FAILURE: Got exception ' + e.message + ' when creating document with empty namespaceURI')
+        return;
+    }
+
+    // namespaceURI with empty qname
+    try {
+        var doc = document.implementation.createDocument(uri, '', null)
+        
+        if (doc.documentElement) {
+            debug('FAILURE: Document created should not have a document element')
+            return;
+        }
+        
+    } catch (e) {
+        debug('FAILURE: Got exception ' + e.message + ' when creating document with empty namespaceURI')
+        return;
+    }
+    
+    debug('SUCCESS!')
+}
+
+</script>
+</head>
+<body onload="runTests();">
+This tests that it should be possible to create documents with empty/null qnames and namespaceURIs. If the test is successful, 'SUCCESS' will be displayed below, otherwise 'FAILURE' and a reason will be displayed.
+<pre id="console">
+</pre>
+</body>
+</html>