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

Side by Side Diff: LayoutTests/fast/dom/XMLSerializer-doctype2.html

Issue 16818023: DOMException toString is not correct (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 function debug(str) { 4 function debug(str) {
5 li = document.createElement('li'); 5 li = document.createElement('li');
6 li.appendChild(document.createTextNode(str)); 6 li.appendChild(document.createTextNode(str));
7 document.getElementById('console').appendChild(li); 7 document.getElementById('console').appendChild(li);
8 } 8 }
9 9
10 function runTests() { 10 function runTests() {
11 if (window.testRunner) 11 if (window.testRunner)
12 testRunner.dumpAsText(); 12 testRunner.dumpAsText();
13 13
14 var docType = window.document.implementation.createDocumentType("aDo cTypeName", "aPublicID", "aSystemID"); 14 var docType = window.document.implementation.createDocumentType("aDo cTypeName", "aPublicID", "aSystemID");
15 15
16 var serializer = new XMLSerializer(); 16 var serializer = new XMLSerializer();
17 17
18 try { 18 try {
19 var text = serializer.serializeToString(docType); 19 var text = serializer.serializeToString(docType);
20 debug("FAIL: XMLSerializer.serializeToString() should throw an e xception if it tries to serialize a documentless DocumentType node."); 20 debug("FAIL: XMLSerializer.serializeToString() should throw an e xception if it tries to serialize a documentless DocumentType node.");
21 } catch (e) { 21 } catch (e) {
22 if (e == "Error: InvalidAccessError: DOM Exception 15") 22 if (e == "InvalidAccessError: A parameter or an operation was no t supported by the underlying object.")
23 debug("PASS: an " + e + " was thrown as expected.") 23 debug("PASS: an " + e + " was thrown as expected.")
24 else 24 else
25 debug("FAIL: XMLSerializer.serializeToString() should throw an INVALID_ACCESS_ERR DOMExeption if it tries to serialize a documentless Docume ntType node."); 25 debug("FAIL: XMLSerializer.serializeToString() should throw an InvalidAccessError DOMExeption if it tries to serialize a documentless Docume ntType node.");
26 } 26 }
27 } 27 }
28 </script> 28 </script>
29 </head> 29 </head>
30 <body onload="runTests()"> 30 <body onload="runTests()">
31 This tests XMLSerializer.serializeToString() on a DocumentType node that does no t have a document associated 31 This tests XMLSerializer.serializeToString() on a DocumentType node that does no t have a document associated
32 with it. It should throw an INVALID_ACCESS_ERR DOMException. 32 with it. It should throw an INVALID_ACCESS_ERR DOMException.
33 33
34 <ul id="console"> 34 <ul id="console">
35 </ul> 35 </ul>
36 </body> 36 </body>
37 </html> 37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698