Bug 1587789 - Remove isXBLAnonymous functions defined and used in the inspector....
[gecko.git] / devtools / client / inspector / markup / test / browser_markup_anonymous_04.js
blob3f23ca66a8713139a183c2f35d6ddc96a073c688
1 /* Any copyright is dedicated to the Public Domain.
2  http://creativecommons.org/publicdomain/zero/1.0/ */
4 "use strict";
6 // Test native anonymous content in the markupview with
7 // devtools.inspector.showAllAnonymousContent set to true
8 const TEST_URL = URL_ROOT + "doc_markup_anonymous.html";
9 const PREF = "devtools.inspector.showAllAnonymousContent";
11 add_task(async function() {
12   Services.prefs.setBoolPref(PREF, true);
14   const { inspector } = await openInspectorForURL(TEST_URL);
16   const native = await getNodeFront("#native", inspector);
18   // Markup looks like: <div><input type="file"></div>
19   const nativeChildren = await inspector.walker.children(native);
20   is(nativeChildren.nodes.length, 1, "Children returned from walker");
22   info("Checking the input element");
23   const child = nativeChildren.nodes[0];
24   ok(!child.isAnonymous, "<input type=file> is not anonymous");
26   const grandchildren = await inspector.walker.children(child);
27   is(
28     grandchildren.nodes.length,
29     2,
30     "<input type=file> has native anonymous children"
31   );
33   for (const node of grandchildren.nodes) {
34     ok(node.isAnonymous, "Child is anonymous");
35     ok(!node._form.isShadowAnonymous, "Child is not shadow anonymous");
36     ok(node._form.isNativeAnonymous, "Child is native anonymous");
37     await isEditingMenuDisabled(node, inspector);
38   }
39 });