diff options
author | Connor Brewster <connor.brewster@eagles.oc.edu> | 2017-06-13 15:01:34 -0600 |
---|---|---|
committer | Connor Brewster <connor.brewster@eagles.oc.edu> | 2017-06-15 21:33:30 -0600 |
commit | 81e28a2b5f40b4c2d45e6e5f366378a3c0340378 (patch) | |
tree | 04545c82d621d52afb4f8c3b5161a7f14e5ce27e | |
parent | 1f3fd77d8f8fc5820115db6f817ed9672c7c9259 (diff) | |
download | servo-81e28a2b5f40b4c2d45e6e5f366378a3c0340378.tar.gz servo-81e28a2b5f40b4c2d45e6e5f366378a3c0340378.zip |
Test steps 4 and 5 of the HTMLConstructor
-rw-r--r-- | tests/wpt/metadata/MANIFEST.json | 2 | ||||
-rw-r--r-- | tests/wpt/web-platform-tests/custom-elements/HTMLElement-constructor.html | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index a235abdc2e5..02bcc380548 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -554120,7 +554120,7 @@ "testharness" ], "custom-elements/HTMLElement-constructor.html": [ - "7fefdaa4cbdf30c505858730a5a3858e9db5dbc2", + "64522527ef425b90c704b20b000c8feef0d1ca25", "testharness" ], "custom-elements/OWNERS": [ diff --git a/tests/wpt/web-platform-tests/custom-elements/HTMLElement-constructor.html b/tests/wpt/web-platform-tests/custom-elements/HTMLElement-constructor.html index 1ed625f63bb..cb6d5409962 100644 --- a/tests/wpt/web-platform-tests/custom-elements/HTMLElement-constructor.html +++ b/tests/wpt/web-platform-tests/custom-elements/HTMLElement-constructor.html @@ -28,6 +28,18 @@ test(function () { }, 'HTMLElement constructor must throw TypeError when it has not been defined by customElements.define'); test(function () { + class SomeCustomElement extends HTMLParagraphElement {}; + customElements.define('some-custom-element', SomeCustomElement); + assert_throws({'name': 'TypeError'}, function () { new SomeCustomElement(); }); +}, 'Custom element constructor must throw TypeError when it does not extend HTMLElement'); + +test(function () { + class SomeCustomButtonElement extends HTMLButtonElement {}; + customElements.define('some-custom-button-element', SomeCustomButtonElement, { extends: "p" }); + assert_throws({'name': 'TypeError'}, function () { new SomeCustomButtonElement(); }); +}, 'Custom element constructor must throw TypeError when it does not extend the proper element interface'); + +test(function () { class CustomElementWithInferredTagName extends HTMLElement {}; customElements.define('inferred-name', CustomElementWithInferredTagName); |