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

Unified 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, 7 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/custom-elements/constructor-context-dies-before-super.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/constructor-context-dies-before-super.html b/third_party/WebKit/LayoutTests/custom-elements/constructor-context-dies-before-super.html
new file mode 100644
index 0000000000000000000000000000000000000000..cbf88e51da91e07e5d2e6d44297122233e9518e3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/constructor-context-dies-before-super.html
@@ -0,0 +1,45 @@
+<!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('constructor destroys the context before super');
+ 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.
+ class BadConstructor extends HTMLElement {
+ constructor() {
+ destroyContext();
+ super();
+ }
+ }
+ window.customElements.define('x-x', BadConstructor);
+ try {
+ new BadConstructor();
+ } finally {
+ done();
+ }
+}
+
+})();
+</script>
« 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