flutter_flutter/tests/custom-elements/generated-constructor.sky
Elliott Sprehn bb7f5d05bf Improve custom-elements/generated-constructor.sky test.
We should inherit from HTMLElement, Sky (and blink) don't currently
enforce this but they probably should. We should also explicitly
check that the prototype is what we expect.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/809183002
2014-12-17 15:01:17 -08:00

20 lines
604 B
Plaintext

<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 extends HTMLElement {
static test() { return 10; }
}
var TestElement = document.registerElement("test-element-1", {
prototype: TestElementClass.prototype,
});
assert.isFunction(TestElement.test);
assert.equal(TestElement.test(), 10);
assert.equal(Object.getPrototypeOf(TestElement), TestElementClass);
});
});
</script>
</html>