summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/markup/test/browser_markup_anonymous_02.js
blob: b6221c5c32018818062dccc385e24f02afc97d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
 http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

requestLongerTimeout(2);

// Test XBL anonymous content in the markupview
const TEST_URL = "chrome://devtools/content/scratchpad/scratchpad.xul";

add_task(function* () {
  let {inspector} = yield openInspectorForURL(TEST_URL);

  let toolbarbutton = yield getNodeFront("toolbarbutton", inspector);
  let children = yield inspector.walker.children(toolbarbutton);

  is(toolbarbutton.numChildren, 3, "Correct number of children");
  is(children.nodes.length, 3, "Children returned from walker");

  is(toolbarbutton.isAnonymous, false, "Toolbarbutton is not anonymous");
  yield isEditingMenuEnabled(toolbarbutton, inspector);

  for (let 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");
    yield isEditingMenuDisabled(node, inspector);
  }
});