OLD | NEW |
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 Loading... |
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"); |
OLD | NEW |