Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

/* Any copyright is dedicated to the Public Domain.
// Bug 1221150 - Ensure that census trees do not accidentally auto expand
// when clicking on the allocation stacks checkbox.
"use strict";
const {
takeSnapshotAndCensus,
const { viewState } = require("resource://devtools/client/memory/constants.js");
const {
changeView,
const TEST_URL =
this.test = makeMemoryTest(TEST_URL, async function ({ panel }) {
const heapWorker = panel.panelWin.gHeapAnalysesClient;
const { getState, dispatch } = panel.panelWin.gStore;
const front = getState().front;
const doc = panel.panelWin.document;
dispatch(changeView(viewState.CENSUS));
await dispatch(takeSnapshotAndCensus(front, heapWorker));
is(getState().allocations.recording, false);
const recordingCheckbox = doc.getElementById(
"record-allocation-stacks-checkbox"
);
EventUtils.synthesizeMouseAtCenter(recordingCheckbox, {}, panel.panelWin);
is(getState().allocations.recording, true);
const nameElems = [
...doc.querySelectorAll(".heap-tree-item-field.heap-tree-item-name"),
];
for (const el of nameElems) {
dumpn(`Found ${el.textContent.trim()}`);
is(
el.style.marginInlineStart,
"0px",
"None of the elements should be an indented/expanded child"
);
}
});