Chromium Code Reviews| Index: sky/tests/custom-elements/generated-constructor.sky |
| diff --git a/sky/tests/custom-elements/generated-constructor.sky b/sky/tests/custom-elements/generated-constructor.sky |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..619ebc74327eb965bffb349e910e052850963836 |
| --- /dev/null |
| +++ b/sky/tests/custom-elements/generated-constructor.sky |
| @@ -0,0 +1,18 @@ |
| +<html> |
| +<import src="../resources/mocha.sky" /> |
| +<import src="../resources/chai.sky" /> |
| +<script> |
| +describe("Custom element constructor", function() { |
| + it("should inherit from the passed constructor", function() { |
| + class TestElementClass { |
|
arv (Not doing code reviews)
2014/12/17 22:29:43
Don't you need extends HTMLElement as well?
|
| + static test() { return 10; } |
| + } |
| + var TestElement = document.registerElement("test-element-1", { |
| + prototype: TestElementClass.prototype, |
| + }); |
| + assert.isFunction(TestElement.test); |
| + assert.equal(TestElement.test(), 10); |
|
arv (Not doing code reviews)
2014/12/17 22:29:43
Maybe add:
assert.equal(Object.getPrototypeOf(Tes
|
| + }); |
| +}); |
| +</script> |
| +</html> |