Bug 1519577 Update devtools test to use a test-only xbl binding r=jdescottes
authorAndrew Swan <aswan@mozilla.com>
Thu, 02 May 2019 20:39:20 -0700
changeset 474975 8f0abb76f7bb982c13424019f7bda30089acf1e8
parent 474974 8de5e0880f85d8986b2995cd8685245922e41b5f
child 474976 82d77e63f4d3971ee341c6a49daacc6524e9d80c
push id113185
push useraswan@mozilla.com
push dateWed, 22 May 2019 23:25:35 +0000
treeherdermozilla-inbound@c8e9b6a81194 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1519577
milestone69.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 1519577 Update devtools test to use a test-only xbl binding r=jdescottes Differential Revision: https://phabricator.services.mozilla.com/D31938
devtools/client/inspector/markup/test/browser_markup_anonymous_02.js
devtools/client/inspector/markup/test/doc_markup_anonymous_xul.xul
--- a/devtools/client/inspector/markup/test/browser_markup_anonymous_02.js
+++ b/devtools/client/inspector/markup/test/browser_markup_anonymous_02.js
@@ -7,24 +7,24 @@
 requestLongerTimeout(2);
 
 // Test XBL anonymous content in the markupview
 const TEST_URL = URL_ROOT + "doc_markup_anonymous_xul.xul";
 
 add_task(async function() {
   const {inspector} = await openInspectorForURL(TEST_URL);
 
-  const toolbarbutton = await getNodeFront("toolbarbutton", inspector);
-  const children = await inspector.walker.children(toolbarbutton);
+  const boundNode = await getNodeFront("#xbl-host", inspector);
+  const children = await inspector.walker.children(boundNode);
 
-  is(toolbarbutton.numChildren, 4, "Correct number of children");
-  is(children.nodes.length, 4, "Children returned from walker");
+  is(boundNode.numChildren, 2, "Correct number of children");
+  is(children.nodes.length, 2, "Children returned from walker");
 
-  is(toolbarbutton.isAnonymous, false, "Toolbarbutton is not anonymous");
-  await isEditingMenuEnabled(toolbarbutton, inspector);
+  is(boundNode.isAnonymous, false, "Node with XBL binding is not anonymous");
+  await isEditingMenuEnabled(boundNode, inspector);
 
   for (const node of children.nodes) {
     ok(node.isAnonymous, "Child is anonymous");
     ok(node._form.isXBLAnonymous, "Child is XBL anonymous");
     ok(!node._form.isShadowAnonymous, "Child is not shadow anonymous");
     ok(!node._form.isNativeAnonymous, "Child is not native anonymous");
     await isEditingMenuDisabled(node, inspector);
   }
--- a/devtools/client/inspector/markup/test/doc_markup_anonymous_xul.xul
+++ b/devtools/client/inspector/markup/test/doc_markup_anonymous_xul.xul
@@ -1,8 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <xul:window xmlns="http://www.w3.org/1999/xhtml"
             xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
             title="Test anonymous xul nodes.">
-  <xul:toolbarbutton id="test"></xul:toolbarbutton>
+  <xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl"
+                xmlns:xul="http://www.mozilla.org/keymaster/gaktekeeper/there.is.only.xul">
+    <xbl:binding id="test">
+      <xbl:content>
+        <xul:box anonid="xbl-anon1">Anonymous</xul:box>
+        <xul:box anonid="xbl-anon2">Anonymous</xul:box>
+      </xbl:content>
+    </xbl:binding>
+  </xbl:bindings>
+  <box id="xbl-host" style="-moz-binding: url(#test)"/>
 </xul:window>