function test_constructor(ctor) { test(function() { var object = new window[ctor](); assert_equals(Object.getPrototypeOf(object), window[ctor].prototype, "Prototype chain: " + ctor); assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(object)), CharacterData.prototype, "Prototype chain: CharacterData"); assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(object))), Node.prototype, "Prototype chain: Node"); }, "new " + ctor + "(): prototype chain"); test(function() { var object = new window[ctor](); assert_true(object instanceof Node, "Should be a Node"); assert_true(object instanceof CharacterData, "Should be a CharacterData"); assert_true(object instanceof window[ctor], "Should be a " + ctor); }, "new " + ctor + "(): instanceof"); test(function() { var object = new window[ctor](); assert_equals(object.data, ""); assert_equals(object.nodeValue, ""); assert_equals(object.ownerDocument, document); }, "new " + ctor + "(): no arguments"); var testArgs = [ [undefined, ""], [null, "null"], [42, "42"], ["", ""], ["-", "-"], ["--", "--"], ["-->", "-->"], ["