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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/spec/adopt-node.html

Issue 2170383002: CustomElements: adopt node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: workflow commit Created 4 years, 5 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
Index: third_party/WebKit/LayoutTests/custom-elements/spec/adopt-node.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/adopt-node.html b/third_party/WebKit/LayoutTests/custom-elements/spec/adopt-node.html
new file mode 100644
index 0000000000000000000000000000000000000000..f0a780456ec6da1a8ded508d9527de19bbc167cb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/adopt-node.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<title>Custom Elements: adopt node</title>
+<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-adopt">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="resources/custom-elements-helpers.js"></script>
+<body>
+<script>
+'use strict'
+// 3.2 For each inclusiveDescendant in node’s shadow-including inclusive descendants that is a custom
+// element, enqueue a custom element callback reaction with inclusiveDescendant,
+// callback name "adoptedCallback", and an empty argument list.
+promise_test((t) => {
+ return Promise.all([
+ create_window_in_test(t),
dominicc (has gone to gerrit) 2016/07/28 02:45:59 Maybe indent these two lines, two spaces?
+ create_window_in_test(t)])
+ .then(([w1, w2]) => {
+ let invocations = [];
+ class X extends w1.HTMLElement {
+ constructor() { super(); }
+ adoptedCallback() { invocations.push('adopted'); }
+ }
+ w1.customElements.define('a-a', X);
+ let a = w1.document.createElement('a-a');
+ w2.document.adoptNode(a);
+ // TODO(davaajav):write more specific assertion witj assert_array_equals_callback_invocations from helpers
dominicc (has gone to gerrit) 2016/07/28 02:45:59 spelling: with
+ assert_array_equals(invocations, ['adopted']);
+ });
+}, 'adopting a custom element to the different document should enqueue an adoptedCallback reaction');
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698