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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/constructor-context-dies-cross-context-call.html

Issue 2441943002: Retrieve prototype during custom element construction. (Closed)
Patch Set: Update after https://codereview.chromium.org/2443543002 Created 4 years, 1 month 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 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="../fast/dom/custom/testutils.js"></script> 4 <script src="../fast/dom/custom/testutils.js"></script>
5 <body> 5 <body>
6 <script> 6 <script>
7 'use strict'; 7 'use strict';
8 8
9 // TODO(dominicc): Port fork() etc. to work with testharness, then 9 // TODO(dominicc): Port fork() etc. to work with testharness, then
10 // remove these. 10 // remove these.
11 function debug() {} 11 function debug() {}
12 function finishJSTest() {} 12 function finishJSTest() {}
13 13
14 (() => { 14 (() => {
15 15
16 if (fork()) { 16 if (fork()) {
17 // The controlling parent frame. 17 // The controlling parent frame.
18 let t = async_test('context is destroyed; call across context'); 18 let t = async_test('context is destroyed; call across context');
19 let watcher = new EventWatcher(t, window, 'message'); 19 let watcher = new EventWatcher(t, window, 'message');
20 watcher.wait_for('message').then(t.step_func((event) => { 20 watcher.wait_for('message').then(t.step_func((event) => {
21 assert_equals(event.data, 'PASS destroyed context'); 21 assert_equals(event.data, 'PASS destroyed context');
22 return watcher.wait_for('message'); 22 return watcher.wait_for('message');
23 })).then(t.step_func((event) => { 23 })).then(t.step_func((event) => {
24 assert_equals(event.data, 'PASS child done'); 24 assert_equals(event.data, 'PASS child done');
25 let e = new window.C(); 25 assert_throws(null, () => new window.C());
26 assert_true(e instanceof C, 'should have created an element');
27 t.done(); 26 t.done();
28 })); 27 }));
29 } else { 28 } else {
30 // The child frame. 29 // The child frame.
31 class C extends HTMLElement {} 30 class C extends HTMLElement {}
32 window.customElements.define('a-a', C); 31 window.customElements.define('a-a', C);
33 window.parent.C = C; 32 window.parent.C = C;
34 destroyContext(); 33 destroyContext();
35 done(); 34 done();
36 } 35 }
37 36
38 })(); 37 })();
39 </script> 38 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698