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

Side by Side Diff: LayoutTests/fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js

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 description("createDocument tests modeled after createElementNS tests from mozil la which were attached to webkit bug 16833"); 1 description("createDocument tests modeled after createElementNS tests from mozil la which were attached to webkit bug 16833");
2 2
3 // document.implementation.createDocument() should throw the same set of errors 3 // document.implementation.createDocument() should throw the same set of errors
4 // as document.createElementNS() 4 // as document.createElementNS()
5 // http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocume nt 5 // http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocume nt
6 // Thus we copied these test cases from: 6 // Thus we copied these test cases from:
7 // LayoutTests/fast/dom/Document/resources/createDocument-namespace-err.js 7 // LayoutTests/fast/dom/Document/resources/createDocument-namespace-err.js
8 8
9 function assert(c, m) 9 function assert(c, m)
10 { 10 {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 msg += "; " + test.message; 130 msg += "; " + test.message;
131 try { 131 try {
132 doc[createFunctionName].apply(doc, argsWithExtraLastNull); 132 doc[createFunctionName].apply(doc, argsWithExtraLastNull);
133 assert(!("code" in test), msg); 133 assert(!("code" in test), msg);
134 } catch (e) { 134 } catch (e) {
135 assertEquals(e.code, test.code || "expected no exception", msg); 135 assertEquals(e.code, test.code || "expected no exception", msg);
136 } 136 }
137 } 137 }
138 } 138 }
139 139
140 shouldThrow("document.implementation.createDocument()", "'TypeError: Not enough arguments'"); 140 shouldThrow("document.implementation.createDocument()", '"TypeError: Failed to e xecute \'createDocument\' on \'DOMImplementation\': 2 arguments required, but on ly 0 present."');
141 shouldThrow("document.implementation.createDocument(\"http://www.example.com\")" , "'TypeError: Not enough arguments'"); 141 shouldThrow("document.implementation.createDocument(\"http://www.example.com\")" , '"TypeError: Failed to execute \'createDocument\' on \'DOMImplementation\': 2 arguments required, but only 1 present."');
142 142
143 runNSTests(allNSTests, document.implementation, "createDocument"); 143 runNSTests(allNSTests, document.implementation, "createDocument");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698