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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html

Issue 2144993002: CustomElements: insert a node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html b/third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html
index bfc2cc2887d536719fc03b343de07bc84e75e8dc..80bd4a7b9a39bc4ba34274416e4741d640e5d6f5 100644
--- a/third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/insert-a-node-try-to-upgrade.html
@@ -9,6 +9,27 @@
// Insert a node
// https://dom.spec.whatwg.org/#concept-node-insert
+// 6.5.2.1 If inclusiveDescendant is custom, then enqueue a custom element callback reaction
+// with inclusiveDescendant, callback name "connectedCallback", and an empty argument list.
+test_with_window(w => {
+ let element = w.document.createElement('a-a');
+ let invocations = [];
+ let connectedCallback_args;
+ w.customElements.define('a-a', class extends w.HTMLElement {
+ constructor() { super(); }
dominicc (has gone to gerrit) 2016/07/13 06:19:06 You can omit this line; I think an ES6 class gets
+ connectedCallback() {
+ invocations.push(['connected', this]);
+ connectedCallback_args = arguments;
+ }
+ });
+ w.document.body.appendChild(element);
+ assert_true(element.matches(':defined'));
+ w.document.body.appendChild(element);
+ assert_equals(invocations.length, 1, 'connectedCallback should be invoked only once');
dominicc (has gone to gerrit) 2016/07/13 06:19:05 Could you also assert the length is 1 before line
+ assert_array_equals(invocations[0], ['connected', element], 'insierting "custom" element should enqueue a connectedCallback reaction');
dominicc (has gone to gerrit) 2016/07/13 06:19:05 Spelling--inserting
+ assert_array_equals(connectedCallback_args, [], 'connectedCallback should be invoked with empty argument list');
+}, 'Insert a node that is "custom" should enqueue connectedCallback');
+
// 6.5.2.2. try to upgrade inclusiveDescendant.
// Try to upgrade an element
// https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698