OLD | NEW |
1 function test_constructor(ctor) { | 1 function test_constructor(ctor) { |
2 test(function() { | 2 test(function() { |
3 var object = new window[ctor](); | 3 var object = new window[ctor](); |
4 assert_equals(Object.getPrototypeOf(object), | 4 assert_equals(Object.getPrototypeOf(object), |
5 window[ctor].prototype, "Prototype chain: " + ctor); | 5 window[ctor].prototype, "Prototype chain: " + ctor); |
6 assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(object)), | 6 assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(object)), |
7 CharacterData.prototype, "Prototype chain: CharacterData"); | 7 CharacterData.prototype, "Prototype chain: CharacterData"); |
8 assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototyp
eOf(object))), | 8 assert_equals(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototyp
eOf(object))), |
9 Node.prototype, "Prototype chain: Node"); | 9 Node.prototype, "Prototype chain: Node"); |
10 }, "new " + ctor + "(): prototype chain"); | 10 }, "new " + ctor + "(): prototype chain"); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 async_test("new " + ctor + "() should get the correct ownerDocument across glo
bals").step(function() { | 69 async_test("new " + ctor + "() should get the correct ownerDocument across glo
bals").step(function() { |
70 var iframe = document.createElement("iframe"); | 70 var iframe = document.createElement("iframe"); |
71 iframe.onload = this.step_func_done(function() { | 71 iframe.onload = this.step_func_done(function() { |
72 var object = new iframe.contentWindow[ctor](); | 72 var object = new iframe.contentWindow[ctor](); |
73 assert_equals(object.ownerDocument, iframe.contentDocument); | 73 assert_equals(object.ownerDocument, iframe.contentDocument); |
74 }); | 74 }); |
75 document.body.appendChild(iframe); | 75 document.body.appendChild(iframe); |
76 }); | 76 }); |
77 } | 77 } |
OLD | NEW |