mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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
20 lines
604 B
Plaintext
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>
|