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

Side by Side Diff: LayoutTests/fast/dom/implementation-api-args.html

Issue 24203002: Improve generated "Not enough arguments." TypeError exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 7 years, 3 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <link rel="help" href="http://www.w3.org/TR/2012/WD-dom-20121206/#interface-domi mplementation"> 4 <link rel="help" href="http://www.w3.org/TR/2012/WD-dom-20121206/#interface-domi mplementation">
5 <script src="../js/resources/js-test-pre.js"></script> 5 <script src="../js/resources/js-test-pre.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <script> 8 <script>
9 description("Checks that the DOMImplementation api arguments are correctly valid ated") 9 description("Checks that the DOMImplementation api arguments are correctly valid ated")
10 10
(...skipping 17 matching lines...) Expand all
28 shouldBeNull('testDocument.documentElement.namespaceURI'); 28 shouldBeNull('testDocument.documentElement.namespaceURI');
29 } 29 }
30 30
31 if (docType) 31 if (docType)
32 shouldBe('testDocument.doctype', 'testDocType'); 32 shouldBe('testDocument.doctype', 'testDocType');
33 else 33 else
34 shouldBeNull('testDocument.doctype'); 34 shouldBeNull('testDocument.doctype');
35 } 35 }
36 36
37 debug('\nDocumentType createDocumentType(DOMString qualifiedName, DOMString publ icId, DOMString systemId);'); 37 debug('\nDocumentType createDocumentType(DOMString qualifiedName, DOMString publ icId, DOMString systemId);');
38 shouldThrow('document.implementation.createDocumentType()', "'TypeError: Not eno ugh arguments'"); 38 shouldThrow('document.implementation.createDocumentType()', '"TypeError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': 3 arguments required , but only 0 present."');
39 shouldThrow('document.implementation.createDocumentType("qualifiedName")', "'Typ eError: Not enough arguments'"); 39 shouldThrow('document.implementation.createDocumentType("qualifiedName")', '"Typ eError: Failed to execute \'createDocumentType\' on \'DOMImplementation\': 3 arg uments required, but only 1 present."');
40 shouldThrow('document.implementation.createDocumentType("qualifiedName", "public Id")', "'TypeError: Not enough arguments'"); 40 shouldThrow('document.implementation.createDocumentType("qualifiedName", "public Id")', '"TypeError: Failed to execute \'createDocumentType\' on \'DOMImplementat ion\': 3 arguments required, but only 2 present."');
41 var docType; 41 var docType;
42 shouldNotThrow('docType = document.implementation.createDocumentType("qualifiedN ame", "publicId", "systemId")'); 42 shouldNotThrow('docType = document.implementation.createDocumentType("qualifiedN ame", "publicId", "systemId")');
43 shouldBe('docType.__proto__', 'DocumentType.prototype'); 43 shouldBe('docType.__proto__', 'DocumentType.prototype');
44 shouldBeEqualToString('docType.name', 'qualifiedName'); 44 shouldBeEqualToString('docType.name', 'qualifiedName');
45 shouldBeEqualToString('docType.publicId', 'publicId'); 45 shouldBeEqualToString('docType.publicId', 'publicId');
46 shouldBeEqualToString('docType.systemId', 'systemId'); 46 shouldBeEqualToString('docType.systemId', 'systemId');
47 47
48 debug('\nXMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyStri ng] DOMString qualifiedName, DocumentType? doctype);'); 48 debug('\nXMLDocument createDocument(DOMString? namespace, [TreatNullAs=EmptyStri ng] DOMString qualifiedName, DocumentType? doctype);');
49 shouldThrow('document.implementation.createDocument()', "'TypeError: Not enough arguments'"); 49 shouldThrow('document.implementation.createDocument()', '"TypeError: Failed to e xecute \'createDocument\' on \'DOMImplementation\': 2 arguments required, but on ly 0 present."');
50 shouldThrow('document.implementation.createDocument("namespace")', "'TypeError: Not enough arguments'"); 50 shouldThrow('document.implementation.createDocument("namespace")', '"TypeError: Failed to execute \'createDocument\' on \'DOMImplementation\': 2 arguments requi red, but only 1 present."');
51 shouldNotThrow('document.implementation.createDocument("namespace", "qualifiedNa me")'); 51 shouldNotThrow('document.implementation.createDocument("namespace", "qualifiedNa me")');
52 var doc; 52 var doc;
53 shouldNotThrow('doc = document.implementation.createDocument("namespace", "quali fiedName", null)'); 53 shouldNotThrow('doc = document.implementation.createDocument("namespace", "quali fiedName", null)');
54 validateDocument(doc, 'XMLDocument', 'namespace', 'qualifiedName', null); 54 validateDocument(doc, 'XMLDocument', 'namespace', 'qualifiedName', null);
55 shouldNotThrow('doc = document.implementation.createDocument(null, "qualifiedNam e", null)'); 55 shouldNotThrow('doc = document.implementation.createDocument(null, "qualifiedNam e", null)');
56 validateDocument(doc, 'XMLDocument', null, 'qualifiedName', null); 56 validateDocument(doc, 'XMLDocument', null, 'qualifiedName', null);
57 shouldNotThrow('doc = document.implementation.createDocument("", null, null)') 57 shouldNotThrow('doc = document.implementation.createDocument("", null, null)')
58 validateDocument(doc, 'XMLDocument', "", null, null); 58 validateDocument(doc, 'XMLDocument', "", null, null);
59 shouldNotThrow('doc = document.implementation.createDocument("", "", null)') 59 shouldNotThrow('doc = document.implementation.createDocument("", "", null)')
60 validateDocument(doc, 'XMLDocument', "", "", null); 60 validateDocument(doc, 'XMLDocument', "", "", null);
61 shouldNotThrow('doc = document.implementation.createDocument("namespace", "quali fiedName")'); 61 shouldNotThrow('doc = document.implementation.createDocument("namespace", "quali fiedName")');
62 validateDocument(doc, 'XMLDocument', "namespace", "qualifiedName", null); 62 validateDocument(doc, 'XMLDocument', "namespace", "qualifiedName", null);
63 shouldNotThrow('doc = document.implementation.createDocument("namespace", "quali fiedName", docType)'); 63 shouldNotThrow('doc = document.implementation.createDocument("namespace", "quali fiedName", docType)');
64 validateDocument(doc, 'XMLDocument', "namespace", "qualifiedName", docType); 64 validateDocument(doc, 'XMLDocument', "namespace", "qualifiedName", docType);
65 65
66 debug('\nDocument createHTMLDocument(optional DOMString title);'); 66 debug('\nDocument createHTMLDocument(optional DOMString title);');
67 shouldNotThrow('doc = document.implementation.createHTMLDocument()'); 67 shouldNotThrow('doc = document.implementation.createHTMLDocument()');
68 validateDocument(doc, 'HTMLDocument', "http://www.w3.org/1999/xhtml", "HTML", do c.doctype); 68 validateDocument(doc, 'HTMLDocument', "http://www.w3.org/1999/xhtml", "HTML", do c.doctype);
69 shouldNotThrow('doc = document.implementation.createHTMLDocument("title")'); 69 shouldNotThrow('doc = document.implementation.createHTMLDocument("title")');
70 validateDocument(doc, 'HTMLDocument', "http://www.w3.org/1999/xhtml", "HTML", do c.doctype); 70 validateDocument(doc, 'HTMLDocument', "http://www.w3.org/1999/xhtml", "HTML", do c.doctype);
71 </script> 71 </script>
72 <script src="../js/resources/js-test-post.js"></script> 72 <script src="../js/resources/js-test-post.js"></script>
73 </body> 73 </body>
74 </html> 74 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/document-all-tags-expected.txt ('k') | LayoutTests/fast/dom/implementation-api-args-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698