Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ public void execute(MUIElement uiElement, MMenuItem menuItem,
activePart.getContext().set("key", "active");
inactivePart.getContext().set("key", "inactive");

// Ensure all pending UI events are processed before triggering the menu item
contextRule.spinEventLoop();

assertFalse(executed[0]);

Object widget1 = menuItem.getWidget();
Expand Down Expand Up @@ -836,6 +839,10 @@ public void execute(MUIElement uiElement, MMenuItem menuItem,
activePart.getContext().set("key", "active");
inactivePart.getContext().set("key", "inactive");

// Ensure all pending UI events are processed before triggering the menu item
// This prevents race conditions where the handler may not be fully registered yet
contextRule.spinEventLoop();

assertFalse(executed[0]);
assertEquals(activePart, window.getContext().get(EPartService.class)
.getActivePart());
Expand Down
Loading