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

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

Issue 2003033004: Split custom element script use and move it into bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback. Created 4 years, 6 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/constructor-context-dies-cross-context-call.html » ('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 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharness-helpers.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="../fast/dom/custom/testutils.js"></script>
6 <body>
7 <script>
8 'use strict';
9
10 // TODO(dominicc): Port fork() etc. to work with testharness, then
11 // remove these.
12 function debug() {}
13 function finishJSTest() {}
14
15 (() => {
16
17 if (fork()) {
18 // The controlling parent frame.
19 let t = async_test('constructor destroys the context before super');
20 let watcher = new EventWatcher(t, window, 'message');
21 watcher.wait_for('message').then(t.step_func((event) => {
22 assert_equals(event.data, 'PASS destroyed context');
23 return watcher.wait_for('message');
24 })).then(t.step_func((event) => {
25 assert_equals(event.data, 'PASS child done');
26 t.done();
27 }));
28 } else {
29 // The child frame.
30 class BadConstructor extends HTMLElement {
31 constructor() {
32 destroyContext();
33 super();
34 }
35 }
36 window.customElements.define('x-x', BadConstructor);
37 try {
38 new BadConstructor();
39 } finally {
40 done();
41 }
42 }
43
44 })();
45 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-elements/constructor-context-dies-cross-context-call.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698