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

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

Issue 2828643002: Make customElements.define faster
Patch Set: Try to make Android builder happy. Created 3 years, 8 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Custom Elements: defineElement</title> 2 <title>Custom Elements: defineElement</title>
3 <link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#cus tomelementsregistry"> 3 <link rel="help" href="https://html.spec.whatwg.org/multipage/scripting.html#cus tomelementsregistry">
4 <meta name="author" title="Dominic Cooney" href="mailto:dominicc@chromium.org"> 4 <meta name="author" title="Dominic Cooney" href="mailto:dominicc@chromium.org">
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="resources/custom-elements-helpers.js"></script> 7 <script src="resources/custom-elements-helpers.js"></script>
8 <body> 8 <body>
9 <script> 9 <script>
10 // TODO(dominicc): Merge these tests with 10 // TODO(dominicc): Merge these tests with
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 w.customElements.define('a-a', X); 84 w.customElements.define('a-a', X);
85 assert_throws_dom_exception(w, 'NotSupportedError', () => { 85 assert_throws_dom_exception(w, 'NotSupportedError', () => {
86 w.customElements.define('a-b', X); 86 w.customElements.define('a-b', X);
87 }, 'defining an element with a constructor that is already in the ' + 87 }, 'defining an element with a constructor that is already in the ' +
88 'registry should throw a NotSupportedError'); 88 'registry should throw a NotSupportedError');
89 }, 'Reused constructor'); 89 }, 'Reused constructor');
90 90
91 promise_test((t) => { 91 promise_test((t) => {
92 return Promise.all([create_window_in_test(t), create_window_in_test(t)]) 92 return Promise.all([create_window_in_test(t), create_window_in_test(t)])
93 .then(([w1, w2]) => { 93 .then(([w1, w2]) => {
94 class X extends w2.HTMLElement { }; 94 class X extends w1.HTMLElement { };
95 w1.customElements.define('first-name', X); 95 w1.customElements.define('first-name', X);
96 w2.customElements.define('second-name', X); 96 w2.customElements.define('second-name', X);
97 assert_equals( 97 assert_equals(
98 new X().localName, 'second-name', 98 new X().localName, 'first-name',
99 'the current global object should determine which definition is ' + 99 'the current global object should determine which definition is ' +
100 'operative; because X extends w2.HTMLElement, w2 is operative'); 100 'operative; because X extends w1.HTMLElement, w1 is operative');
101 }); 101 });
102 }, 'HTMLElement constructor looks up definitions in the current global-' + 102 }, 'HTMLElement constructor looks up definitions in the current global-' +
103 'reused constructor'); 103 'reused constructor');
104 104
105 promise_test((t) => { 105 promise_test((t) => {
106 return Promise.all([create_window_in_test(t), create_window_in_test(t)]) 106 return Promise.all([create_window_in_test(t), create_window_in_test(t)])
107 .then(([w1, w2]) => { 107 .then(([w1, w2]) => {
108 class X extends w2.HTMLElement { }; 108 class X extends w2.HTMLElement { };
109 w1.customElements.define('x-x', X); 109 w1.customElements.define('x-x', X);
110 assert_throws( 110 assert_throws(
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 static get observedAttributes() { 424 static get observedAttributes() {
425 return attributes; 425 return attributes;
426 } 426 }
427 } 427 }
428 assert_throws(TypeError.prototype, () => { 428 assert_throws(TypeError.prototype, () => {
429 w.customElements.define('x-x', X); 429 w.customElements.define('x-x', X);
430 }); 430 });
431 }, 'Throwing an exception in observedAttributes'); 431 }, 'Throwing an exception in observedAttributes');
432 </script> 432 </script>
433 </body> 433 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698