Chromium Code Reviews| Index: LayoutTests/fast/dom/custom/inherited-prototype.html |
| diff --git a/LayoutTests/fast/dom/custom/inherited-prototype.html b/LayoutTests/fast/dom/custom/inherited-prototype.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c60367b7f85f1943a25eaf13d412a36d79852f20 |
| --- /dev/null |
| +++ b/LayoutTests/fast/dom/custom/inherited-prototype.html |
| @@ -0,0 +1,44 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| +<body> |
| +<script> |
| +test(function () { |
| + var protoA = Object.create(HTMLDivElement.prototype); |
| + var A = document.registerElement('x-a', { |
| + extends: 'div', prototype: protoA}); |
| + |
| + |
|
dominicc (has gone to gerrit)
2015/04/09 06:37:57
Less vertical whitespace here.
deepak.s
2015/04/15 06:44:53
Done.
|
| + assert_equals( |
| + Object.getPrototypeOf(A), HTMLDivElement, |
| + 'generated constructor prototype should be base element constructor ' + |
| + '(extend built-in element)'); |
| + |
| + assert_equals( |
| + A.__proto__, HTMLDivElement, |
| + 'Internal prototype should also be base element function object ' + |
| + '(extend built-in element)'); |
| + |
| + assert_equals( |
| + A.prototype.__proto__, HTMLDivElement.prototype, |
| + 'Internal prototype of generated constructor prototype should be ' + |
| + 'prototype of base element function object (extend built-in element)'); |
| + |
| + var protoB = Object.create(protoA); |
| + var B = document.registerElement('x-b', {prototype: protoB}); |
| + assert_equals( |
| + Object.getPrototypeOf(B), A, |
| + 'generated constructor prototype should be base element constructor ' + |
| + '(extend Custom Element)'); |
| + |
| + assert_equals( |
| + B.__proto__, A, |
| + 'Internal prototype should also be base element function object ' + |
| + '(extend Custom Element)'); |
| + |
| + assert_equals( |
| + B.prototype.__proto__, A.prototype, |
| + 'Internal prototype of generated constructor prototype should be ' + |
| + 'prototype of base element function object (extend Custom Element)'); |
| +}, 'generated constructor prototype property'); |
| +</script> |