Commit 6ae637e5 authored by Alexandre Poirot's avatar Alexandre Poirot
Browse files

Bug 1757937b - [devtools] Fix race condition when toggling expand all context menu. r=bomsy

We weren't waiting for the context menu to hide when clicking on the menu entry.

Differential Revision: https://phabricator.services.mozilla.com/D141186
parent d18ce947
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1067,9 +1067,14 @@ function findSourceNodeWithText(dbg, text) {
}

async function expandAllSourceNodes(dbg, treeNode) {
  const onContextMenu = waitForContextMenu(dbg);
  rightClickEl(dbg, treeNode);
  await waitForContextMenu(dbg);
  const menupopup = await onContextMenu;
  const onHidden = new Promise(resolve => {
    menupopup.addEventListener("popuphidden", resolve, { once: true });
  });
  selectContextMenuItem(dbg, "#node-menu-expand-all");
  await onHidden;
}

/**