Bug 1944506 - Add Remove condition and Remove log items to the debugger gutter breakpoint context menu. r?bomsy

This commit is contained in:
dualfroz committed 2026-10-11 23:42:20 +02:00
1 parent 400ba3fb5e
commit 628fd9f94d
3 files changed
+80

No files matched your search

@@ -129,6 +129,51 @@ add_task(async function () {
pressKey(dbg, "Enter");
bp = findBreakpoint(dbg, "simple2.js", 5);
is(bp.options.logValue, null, "The log value was removed");
info("The gutter context menu has no remove items for a plain breakpoint");
rightClickElement(dbg, "gutterElement", 5);
const popup = await waitForContextMenu(dbg);
ok(
!findContextMenu(dbg, selectors.breakpointContextMenu.removeCondition),
"Remove condition is not shown"
);
ok(!findContextMenu(dbg, selectors.removeLogItem), "Remove log is not shown");
await closeContextMenu(dbg, popup);
info("The condition can be removed using the gutter context menu");
await setConditionalBreakpoint(dbg, 5, "1");
await waitForCondition(dbg, 1);
await assertConditionBreakpoint(dbg, 5);
rightClickElement(dbg, "gutterElement", 5);
await waitForContextMenu(dbg);
ok(
!findContextMenu(dbg, selectors.removeLogItem),
"Remove log is not shown for a conditional breakpoint"
);
selectContextMenuItem(dbg, selectors.breakpointContextMenu.removeCondition);
await waitForBreakpointWithoutCondition(dbg, "simple2.js", 5);
bp = findBreakpoint(dbg, "simple2.js", 5);
is(bp.options.condition, null, "The condition was removed");
info("The log value can be removed using the gutter context menu");
await setLogPoint(dbg, 5, "44");
await waitForLog(dbg, 44);
await assertLogBreakpoint(dbg, 5);
rightClickElement(dbg, "gutterElement", 5);
await waitForContextMenu(dbg);
ok(
!findContextMenu(dbg, selectors.breakpointContextMenu.removeCondition),
"Remove condition is not shown for a log point"
);
selectContextMenuItem(dbg, selectors.removeLogItem);
await waitForState(dbg, () => {
const breakpoint = findBreakpoint(dbg, "simple2.js", 5);
return breakpoint && !breakpoint.options.logValue;
});
bp = findBreakpoint(dbg, "simple2.js", 5);
is(bp.options.logValue, null, "The log value was removed");
});
function waitForBreakpointWithoutCondition(dbg, url, line) {