Bug 1334043 - Part 3: Update tests for connected callback. r=smaug
authorJessica Jong <jjong@mozilla.com>
Tue, 26 Sep 2017 13:56:03 +0800
changeset 670369 b900023d886cf52415f4eda41efa03da7429c084
parent 670368 f0b6fd27656003fa28792b2c5f6a40ea08fde697
child 670370 3dd36c1c48e3b5c83808efd5dd871da731da1758
push id81612
push userbmo:dharvey@mozilla.com
push dateTue, 26 Sep 2017 10:16:26 +0000
reviewerssmaug
bugs1334043
milestone58.0a1
Bug 1334043 - Part 3: Update tests for connected callback. r=smaug MozReview-Commit-ID: LSSRDvNv59e
dom/tests/mochitest/webcomponents/test_custom_element_callback_innerhtml.html
testing/web-platform/meta/custom-elements/adopted-callback.html.ini
testing/web-platform/meta/custom-elements/connected-callbacks.html.ini
testing/web-platform/meta/custom-elements/custom-element-reaction-queue.html.ini
testing/web-platform/meta/custom-elements/reactions/ChildNode.html.ini
testing/web-platform/meta/custom-elements/reactions/Document.html.ini
testing/web-platform/meta/custom-elements/reactions/Element.html.ini
testing/web-platform/meta/custom-elements/reactions/HTMLOptionsCollection.html.ini
testing/web-platform/meta/custom-elements/reactions/HTMLSelectElement.html.ini
testing/web-platform/meta/custom-elements/reactions/Node.html.ini
testing/web-platform/meta/custom-elements/reactions/ParentNode.html.ini
testing/web-platform/meta/custom-elements/reactions/Range.html.ini
testing/web-platform/meta/custom-elements/upgrading/upgrading-enqueue-reactions.html.ini
--- a/dom/tests/mochitest/webcomponents/test_custom_element_callback_innerhtml.html
+++ b/dom/tests/mochitest/webcomponents/test_custom_element_callback_innerhtml.html
@@ -11,30 +11,30 @@ https://bugzilla.mozilla.org/show_bug.cg
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1102502">Bug 1102502</a>
 <div id="container"></div>
 
 <script>
 
 SimpleTest.waitForExplicitFinish();
 
-var attachedCallbackCount = 0;
+var connectedCallbackCount = 0;
 
 var p = Object.create(HTMLElement.prototype);
 
 p.createdCallback = function() {
   ok(true, "createdCallback called.");
 };
 
-p.attachedCallback = function() {
-  ok(true, "attachedCallback should be called when the parser creates an element in the document.");
-  attachedCallbackCount++;
-  // attachedCallback should be called twice, once for the element created for innerHTML and
+p.connectedCallback = function() {
+  ok(true, "connectedCallback should be called when the parser creates an element in the document.");
+  connectedCallbackCount++;
+  // connectedCallback should be called twice, once for the element created for innerHTML and
   // once for the element created in this document.
-  if (attachedCallbackCount == 2) {
+  if (connectedCallbackCount == 2) {
     SimpleTest.finish();
   }
 }
 
 document.registerElement("x-foo", { prototype: p });
 
 var container = document.getElementById("container");
 container.innerHTML = '<x-foo></x-foo>';
--- a/testing/web-platform/meta/custom-elements/adopted-callback.html.ini
+++ b/testing/web-platform/meta/custom-elements/adopted-callback.html.ini
@@ -1,13 +1,10 @@
 [adopted-callback.html]
   type: testharness
-  [Inserting a custom element into the owner document must not enqueue and invoke adoptedCallback]
-    expected: FAIL
-
   [Inserting a custom element into the document of the template elements must enqueue and invoke adoptedCallback]
     expected: FAIL
 
   [Moving a custom element from the owner document into the document of the template elements must enqueue and invoke adoptedCallback]
     expected: FAIL
 
   [Inserting an ancestor of custom element into the document of the template elements must enqueue and invoke adoptedCallback]
     expected: FAIL
--- a/testing/web-platform/meta/custom-elements/connected-callbacks.html.ini
+++ b/testing/web-platform/meta/custom-elements/connected-callbacks.html.ini
@@ -1,121 +1,73 @@
 [connected-callbacks.html]
   type: testharness
-  [Inserting a custom element into the document must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into the document must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in the document must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into the document must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to the document must not enqueue and invoke connectedCallback]
     expected: FAIL
 
-  [Inserting a custom element into the document of the template elements must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into the document of the template elements must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in the document of the template elements must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into the document of the template elements must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to the document of the template elements must not enqueue and invoke connectedCallback]
     expected: FAIL
 
-  [Inserting a custom element into a new document must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into a new document must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in a new document must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into a new document must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to a new document must not enqueue and invoke connectedCallback]
     expected: FAIL
 
-  [Inserting a custom element into a cloned document must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into a cloned document must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in a cloned document must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into a cloned document must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to a cloned document must not enqueue and invoke connectedCallback]
     expected: FAIL
 
-  [Inserting a custom element into a document created by createHTMLDocument must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into a document created by createHTMLDocument must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in a document created by createHTMLDocument must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into a document created by createHTMLDocument must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to a document created by createHTMLDocument must not enqueue and invoke connectedCallback]
     expected: FAIL
 
-  [Inserting a custom element into an HTML document created by createDocument must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into an HTML document created by createDocument must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in an HTML document created by createDocument must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into an HTML document created by createDocument must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to an HTML document created by createDocument must not enqueue and invoke connectedCallback]
     expected: FAIL
 
-  [Inserting a custom element into the document of an iframe must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into the document of an iframe must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in the document of an iframe must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into the document of an iframe must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to the document of an iframe must not enqueue and invoke connectedCallback]
     expected: FAIL
 
-  [Inserting a custom element into an HTML document fetched by XHR must enqueue and invoke connectedCallback]
-    expected: FAIL
-
-  [Inserting an ancestor of custom element into an HTML document fetched by XHR must enqueue and invoke connectedCallback]
-    expected: FAIL
-
   [Inserting a custom element into a shadow tree in an HTML document fetched by XHR must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting the shadow host of a custom element into an HTML document fetched by XHR must enqueue and invoke connectedCallback]
     expected: FAIL
 
   [Inserting a custom element into a detached shadow tree that belongs to an HTML document fetched by XHR must not enqueue and invoke connectedCallback]
     expected: FAIL
--- a/testing/web-platform/meta/custom-elements/custom-element-reaction-queue.html.ini
+++ b/testing/web-platform/meta/custom-elements/custom-element-reaction-queue.html.ini
@@ -1,11 +1,5 @@
 [custom-element-reaction-queue.html]
   type: testharness
-  [Upgrading a custom element must invoke attributeChangedCallback and connectedCallback before start upgrading another element]
-    expected: FAIL
-
-  [Mutating a undefined custom element while upgrading a custom element must not enqueue or invoke reactions on the mutated element]
-    expected: FAIL
-
   [Mutating another custom element inside adopted callback must invoke all pending callbacks on the mutated element]
     expected: FAIL
 
--- a/testing/web-platform/meta/custom-elements/reactions/ChildNode.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/ChildNode.html.ini
@@ -1,25 +1,16 @@
 [ChildNode.html]
   type: testharness
-  [before on ChildNode must enqueue a connected reaction]
-    expected: FAIL
-
   [before on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
-  [after on ChildNode must enqueue a connected reaction]
-    expected: FAIL
-
   [after on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
-  [replaceWith on ChildNode must enqueue a connected reaction]
-    expected: FAIL
-
   [replaceWith on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
   [replaceWith on ChildNode must enqueue a disconnected reaction]
     expected: FAIL
 
   [remove on ChildNode must enqueue a disconnected reaction]
     expected: FAIL
--- a/testing/web-platform/meta/custom-elements/reactions/Document.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/Document.html.ini
@@ -13,19 +13,16 @@
     expected: FAIL
 
   [title on Document must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
   [body on Document must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
-  [body on Document must enqueue connectedCallback when inserting a custom element]
-    expected: FAIL
-
   [open on Document must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
   [write on Document must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
   [write on Document must enqueue connectedCallback after constructing a custom element]
     expected: FAIL
--- a/testing/web-platform/meta/custom-elements/reactions/Element.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/Element.html.ini
@@ -14,20 +14,17 @@
 
   [removeAttributeNode on Element must not enqueue an attributeChanged reaction when removing an attribute that does not exist]
     expected: FAIL
 
   [undefined must enqueue a connected reaction]
     expected: FAIL
 
   [undefined must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
-    expected: FAIL
-
-  [insertAdjacentElement on Element must enqueue a connected reaction]
-    expected: FAIL
+    expected: FAIL 
 
   [insertAdjacentElement on Element must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
   [innerHTML on Element must enqueue a connected reaction for a newly constructed custom element]
     expected: FAIL
 
   [innerHTML on Element must enqueue a attributeChanged reaction for a newly constructed custom element]
--- a/testing/web-platform/meta/custom-elements/reactions/HTMLOptionsCollection.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/HTMLOptionsCollection.html.ini
@@ -1,17 +1,11 @@
 [HTMLOptionsCollection.html]
   type: testharness
   [length on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
-  [The indexed setter on HTMLOptionsCollection must enqueue connectedCallback when inserting a custom element]
-    expected: FAIL
-
   [The indexed setter on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
-  [add on HTMLOptionsCollection must enqueue connectedCallback when inserting a custom element]
-    expected: FAIL
-
   [remove on HTMLOptionsCollection must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
--- a/testing/web-platform/meta/custom-elements/reactions/HTMLSelectElement.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/HTMLSelectElement.html.ini
@@ -1,17 +1,11 @@
 [HTMLSelectElement.html]
   type: testharness
   [length on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
-  [The indexed setter on HTMLSelectElement must enqueue connectedCallback when inserting a custom element]
-    expected: FAIL
-
   [The indexed setter on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
-  [add on HTMLSelectElement must enqueue connectedCallback when inserting a custom element]
-    expected: FAIL
-
   [remove on HTMLSelectElement must enqueue disconnectedCallback when removing a custom element]
     expected: FAIL
 
--- a/testing/web-platform/meta/custom-elements/reactions/Node.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/Node.html.ini
@@ -4,29 +4,20 @@
     expected: FAIL
 
   [cloneNode on Node must not enqueue an attributeChanged reaction when cloning an element with an unobserved attribute]
     expected: FAIL
 
   [cloneNode on Node must enqueue an attributeChanged reaction when cloning an element only for observed attributes]
     expected: FAIL
 
-  [insertBefore on ChildNode must enqueue a connected reaction]
-    expected: FAIL
-
   [insertBefore on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
-  [appendChild on ChildNode must enqueue a connected reaction]
-    expected: FAIL
-
   [appendChild on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
-  [replaceChild on ChildNode must enqueue a connected reaction]
-    expected: FAIL
-
   [replaceChild on ChildNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
   [removeChild on ChildNode must enqueue a disconnected reaction]
     expected: FAIL
 
--- a/testing/web-platform/meta/custom-elements/reactions/ParentNode.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/ParentNode.html.ini
@@ -1,14 +1,8 @@
 [ParentNode.html]
   type: testharness
-  [prepend on ParentNode must enqueue a connected reaction]
-    expected: FAIL
-
   [prepend on ParentNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
-  [append on ParentNode must enqueue a connected reaction]
-    expected: FAIL
-
   [append on ParentNode must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
--- a/testing/web-platform/meta/custom-elements/reactions/Range.html.ini
+++ b/testing/web-platform/meta/custom-elements/reactions/Range.html.ini
@@ -10,23 +10,17 @@
     expected: FAIL
 
   [cloneContents on Range must not enqueue an attributeChanged reaction when cloning an element with an unobserved attribute]
     expected: FAIL
 
   [cloneContents on Range must enqueue an attributeChanged reaction when cloning an element only for observed attributes]
     expected: FAIL
 
-  [insertNode on Range must enqueue a connected reaction]
-    expected: FAIL
-
   [insertNode on Range must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
-  [surroundContents on Range must enqueue a connected reaction]
-    expected: FAIL
-
   [surroundContents on Range must enqueue a disconnected reaction, an adopted reaction, and a connected reaction when the custom element was in another document]
     expected: FAIL
 
   [createContextualFragment on Range must construct a custom element]
     expected: FAIL
 
deleted file mode 100644
--- a/testing/web-platform/meta/custom-elements/upgrading/upgrading-enqueue-reactions.html.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[upgrading-enqueue-reactions.html]
-  type: testharness
-  [Upgrading a custom element must enqueue connectedCallback if the element in the document]
-    expected: FAIL
-
-  [Upgrading a custom element must enqueue attributeChangedCallback before connectedCallback]
-    expected: FAIL
-