Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/spec/define-builtin-element.html

Issue 2321363002: Custom Elements: layout tests for custom built-in elements definition (Closed)
Patch Set: New file for custom built-in element definition Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-elements/spec/define-builtin-element-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Custom Built-in Elements: define algorithm paths that are reached by cust omized built-in elements</title>
3 <link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#cus tomelementsregistry">
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="resources/custom-elements-helpers.js"></script>
7 <body>
8 <script>
9
10 'use strict';
11
12 test_with_window((w) => {
13 class A extends w.HTMLButtonElement {}
14 let valid_custom_element_names = [
15 'a-a',
16 'z0-y0',
17 'emotion-\u1f60d',
18 'math-\u03b1',
19 'a.b-c'
20 ];
21 valid_custom_element_names.forEach((val) => {
22 assert_throws_dom_exception(w, 'NotSupportedError', () => {
23 w.customElements.define('a-a', A, { extends: val });
24 }, `having valid custon element name element interface (${val}) ` +
25 'for extends should throw a NotSupportedError')
26 });
27 }, 'Element interface for extends is not valid custom element name');
28
29 test_with_window((w) => {
30 class A extends w.HTMLButtonElement {}
31 let HTMLUnknownElement_names = [
32 'bgsound',
33 'blink',
34 'isindex',
35 'multicol',
36 'nextid',
37 'spacer',
38 42
39 ]
40 HTMLUnknownElement_names.forEach((val) => {
41 assert_throws_dom_exception(w, 'NotSupportedError', () => {
42 w.customElements.define('a-a', A, { extends: val });
43 }, `having element interface for extends (${val}) undefined in specs` +
44 ' should throw a NotSupportedError');
45 });
46 }, 'Element interface for extends defined in specification');
47
48 test_with_window((w) => {
49 class A extends w.HTMLButtonElement {}
50 w.customElements.define('defined-name', A, { extends: 'button' });
51 assert_equals(new A().localName, 'button',
52 'localName should be element interface for extends');
53 assert_not_equals(new A().localName, 'defined-name',
54 'localName should not be defined-name');
55 }, 'localName set to element interface for extends');
56 </script>
57 </body>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-elements/spec/define-builtin-element-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698