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
This commit is contained in:
Elliott Sprehn 2014-12-17 15:01:17 -08:00
parent b486b63a64
commit e90cdb9130

View File

@ -4,7 +4,7 @@
<script>
describe("Custom element constructor", function() {
it("should inherit from the passed constructor", function() {
class TestElementClass {
class TestElementClass extends HTMLElement {
static test() { return 10; }
}
var TestElement = document.registerElement("test-element-1", {
@ -12,6 +12,7 @@ describe("Custom element constructor", function() {
});
assert.isFunction(TestElement.test);
assert.equal(TestElement.test(), 10);
assert.equal(Object.getPrototypeOf(TestElement), TestElementClass);
});
});
</script>