description("createDocument tests modeled after createElementNS tests from mozilla which were attached to webkit bug 16833"); // document.implementation.createDocument() should throw the same set of errors // as document.createElementNS() // http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-DOM-createDocument // Thus we copied these test cases from: // LayoutTests/fast/dom/Document/resources/createDocument-namespace-err.js function assert(c, m) { if (!c) testFailed(m); else testPassed(m); } function stringForExceptionCode(c) { var exceptionName; switch(c) { case DOMException.INVALID_CHARACTER_ERR: exceptionName = "INVALID_CHARACTER_ERR"; break; case DOMException.NAMESPACE_ERR: exceptionName = "NAMESPACE_ERR"; } if (exceptionName) return exceptionName; // + "(" + c + ")"; return c; } function assertEquals(actual, expect, m) { if (actual !== expect) { m += "; expected " + stringForExceptionCode(expect) + ", threw " + stringForExceptionCode(actual); testFailed(m); } else { m += "; threw " + stringForExceptionCode(actual);; testPassed(m); } } var allNSTests = [ { args: [undefined, undefined] }, { args: [null, undefined] }, { args: [undefined, null], code: 5 }, { args: [null, null], code: 5 }, { args: [null, ""], code: 5 }, { args: ["", null], code: 5 }, { args: ["", ""], code: 5 }, { args: [null, "
"], code: 5 }, { args: [null, "0div"], code: 5 }, { args: [null, "di v"], code: 5 }, { args: [null, "di"], code: 5 }, { args: ["http://example.com/", "0div"], code: 5 }, { args: ["http://example.com/", "di