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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/define-context-dies-retrieving-prototype.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
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('retrieving the prototype destroys the context');
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 let BadConstructor = (function () {}).bind({});
31 Object.defineProperty(BadConstructor, 'prototype', {
32 get() {
33 destroyContext();
34 return new Object();
35 }
36 });
37
38 window.customElements.define('x-x', BadConstructor);
39 done();
40 }
41
42 })();
43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698