Bug 1519577 Update devtools test to use a test-only xbl binding r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D31938

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Swan 2019-05-21 19:26:11 +00:00
Родитель c53d46e639
Коммит d81d78cf1f
2 изменённых файлов: 16 добавлений и 7 удалений

Просмотреть файл

@ -12,14 +12,14 @@ 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");

Просмотреть файл

@ -3,6 +3,15 @@
<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>