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

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

Issue 22875013: Make several DOMImplementation API arguments mandatory (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix createDocument() args 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 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 // Moz throws a "Not enough arguments" exception in these, we don't: 140 shouldThrow("document.implementation.createDocument()", "'TypeError: Not enough arguments'");
141 shouldBeEqualToString("document.implementation.createDocument().toString()", "[o bject Document]"); 141 shouldThrow("document.implementation.createDocument(\"http://www.example.com\")" , "'TypeError: Not enough arguments'");
142 shouldBeEqualToString("document.implementation.createDocument(\"http://www.examp le.com\").toString()", "[object Document]");
143 142
144 runNSTests(allNSTests, document.implementation, "createDocument"); 143 runNSTests(allNSTests, document.implementation, "createDocument");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698