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 @@ -20,6 +20,7 @@
import static org.eclipse.core.tests.resources.ResourceTestUtil.createInputStream;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand Down Expand Up @@ -409,12 +410,14 @@ public void testMouseMoveOpensTheToolbarForTheHoveredDiff() throws BadLocationEx
int expectedLine = document().getLineOfOffset(pos.offset);

StyledText tw = viewer().getTextWidget();
Composite toolbarBefore = (Composite) tw.getData(TOOLBAR_COMPOSITE_FOR_ONE_DIFF_KEY);

fireMouseMove(tw, tw.getLinePixel(widgetLineOfModelOffset(viewer(), pos.offset)) + 2);
processEvents();

Composite toolbar = (Composite) tw.getData(TOOLBAR_COMPOSITE_FOR_ONE_DIFF_KEY);
assertNotNull(toolbar, "hovering over a diff must show its toolbar");
assertTrue(toolbar.getVisible(), "the toolbar must be made visible");
assertNotSame(toolbarBefore, toolbar, "hovering over a diff must create a new toolbar composite");
Comment thread
tobiasmelcher marked this conversation as resolved.
Annotation selected = (Annotation) toolbar.getData(CURRENT_SELECTED_UNIFIED_DIFF_ANNO_KEY);
assertNotNull(selected, "the toolbar must remember which diff it was opened for");
Position selectedPos = model.getPosition(selected);
Expand Down
Loading