| Index: third_party/WebKit/LayoutTests/custom-elements/define-context-dies-retrieving-prototype.html
|
| diff --git a/third_party/WebKit/LayoutTests/custom-elements/define-context-dies-retrieving-prototype.html b/third_party/WebKit/LayoutTests/custom-elements/define-context-dies-retrieving-prototype.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..11f624b6c00f4ca256a7950b2931c9da0929bfb1
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/custom-elements/define-context-dies-retrieving-prototype.html
|
| @@ -0,0 +1,43 @@
|
| +<!DOCTYPE html>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharness-helpers.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="../fast/dom/custom/testutils.js"></script>
|
| +<body>
|
| +<script>
|
| +'use strict';
|
| +
|
| +// TODO(dominicc): Port fork() etc. to work with testharness, then
|
| +// remove these.
|
| +function debug() {}
|
| +function finishJSTest() {}
|
| +
|
| +(() => {
|
| +
|
| +if (fork()) {
|
| + // The controlling parent frame.
|
| + let t = async_test('retrieving the prototype destroys the context');
|
| + let watcher = new EventWatcher(t, window, 'message');
|
| + watcher.wait_for('message').then(t.step_func((event) => {
|
| + assert_equals(event.data, 'PASS destroyed context');
|
| + return watcher.wait_for('message');
|
| + })).then(t.step_func((event) => {
|
| + assert_equals(event.data, 'PASS child done');
|
| + t.done();
|
| + }));
|
| +} else {
|
| + // The child frame.
|
| + let BadConstructor = (function () {}).bind({});
|
| + Object.defineProperty(BadConstructor, 'prototype', {
|
| + get() {
|
| + destroyContext();
|
| + return new Object();
|
| + }
|
| + });
|
| +
|
| + window.customElements.define('x-x', BadConstructor);
|
| + done();
|
| +}
|
| +
|
| +})();
|
| +</script>
|
|
|