OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../../resources/testharness.js"></script> | |
3 <script src="../../../resources/testharnessreport.js"></script> | |
4 <body> | |
5 <script> | |
6 test(function () { | |
7 var protoA = Object.create(HTMLDivElement.prototype); | |
8 var A = document.registerElement('x-a', { | |
9 extends: 'div', prototype: protoA}); | |
10 | |
11 | |
dominicc (has gone to gerrit)
2015/04/09 06:37:57
Less vertical whitespace here.
deepak.s
2015/04/15 06:44:53
Done.
| |
12 assert_equals( | |
13 Object.getPrototypeOf(A), HTMLDivElement, | |
14 'generated constructor prototype should be base element constructor ' + | |
15 '(extend built-in element)'); | |
16 | |
17 assert_equals( | |
18 A.__proto__, HTMLDivElement, | |
19 'Internal prototype should also be base element function object ' + | |
20 '(extend built-in element)'); | |
21 | |
22 assert_equals( | |
23 A.prototype.__proto__, HTMLDivElement.prototype, | |
24 'Internal prototype of generated constructor prototype should be ' + | |
25 'prototype of base element function object (extend built-in element)'); | |
26 | |
27 var protoB = Object.create(protoA); | |
28 var B = document.registerElement('x-b', {prototype: protoB}); | |
29 assert_equals( | |
30 Object.getPrototypeOf(B), A, | |
31 'generated constructor prototype should be base element constructor ' + | |
32 '(extend Custom Element)'); | |
33 | |
34 assert_equals( | |
35 B.__proto__, A, | |
36 'Internal prototype should also be base element function object ' + | |
37 '(extend Custom Element)'); | |
38 | |
39 assert_equals( | |
40 B.prototype.__proto__, A.prototype, | |
41 'Internal prototype of generated constructor prototype should be ' + | |
42 'prototype of base element function object (extend Custom Element)'); | |
43 }, 'generated constructor prototype property'); | |
44 </script> | |
OLD | NEW |