Bug 1053898 - Update browser_markup_anonymous_03 test for new shadowdom display;r=bgrins
authorJulian Descottes <jdescottes@mozilla.com>
Wed, 07 Mar 2018 17:47:10 +0100
changeset 410647 65a569c879d9bf2837e009107971c3a8e611dd09
parent 410646 90ece1eb0adea9fa0731709752d46b587890b58f
child 410648 08d2f8f36fb322e148ce8fa4ab8e3889f6b0c103
push id33733
push useraciure@mozilla.com
push dateThu, 29 Mar 2018 22:05:29 +0000
treeherdermozilla-central@7ca58ce09779 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1053898
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1053898 - Update browser_markup_anonymous_03 test for new shadowdom display;r=bgrins MozReview-Commit-ID: FwFkeWuYPwj
devtools/client/inspector/markup/test/browser_markup_anonymous_03.js
--- a/devtools/client/inspector/markup/test/browser_markup_anonymous_03.js
+++ b/devtools/client/inspector/markup/test/browser_markup_anonymous_03.js
@@ -1,35 +1,44 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 // Test shadow DOM content in the markupview.
 // Note that many features are not yet enabled, but basic listing
 // of elements should be working.
 const TEST_URL = URL_ROOT + "doc_markup_anonymous.html";
 
 add_task(async function() {
   Services.prefs.setBoolPref("dom.webcomponents.shadowdom.enabled", true);
 
   let {inspector} = await openInspectorForURL(TEST_URL);
 
-  let shadow = await getNodeFront("#shadow", inspector.markup);
-  let children = await inspector.walker.children(shadow);
+  let shadowHostFront = await getNodeFront("#shadow", inspector.markup);
+  is(shadowHostFront.numChildren, 3, "Children of the shadow host are correct");
 
-  // Bug 1441535.
-  todo_is(shadow.numChildren, 3, "Children of the shadow root are counted");
-  is(children.nodes.length, 3, "Children returned from walker");
+  await inspector.markup.expandNode(shadowHostFront);
+  await waitForMultipleChildrenUpdates(inspector);
+
+  let shadowContainer = inspector.markup.getContainer(shadowHostFront);
+  let containers = shadowContainer.getChildContainers();
 
   info("Checking the ::before pseudo element");
-  let before = children.nodes[0];
+  let before = containers[1].node;
   await isEditingMenuDisabled(before, inspector);
 
+  info("Checking shadow dom children");
+  let shadowRootFront = containers[0].node;
+  let children = await inspector.walker.children(shadowRootFront);
+
+  is(shadowRootFront.numChildren, 2, "Children of the shadow root are counted");
+  is(children.nodes.length, 2, "Children returned from walker");
+
   info("Checking the <h3> shadow element");
-  let shadowChild1 = children.nodes[1];
+  let shadowChild1 = children.nodes[0];
   await isEditingMenuDisabled(shadowChild1, inspector);
 
   info("Checking the <select> shadow element");
-  let shadowChild2 = children.nodes[2];
+  let shadowChild2 = children.nodes[1];
   await isEditingMenuDisabled(shadowChild2, inspector);
 });