Skip to content
Open
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 @@ -63,6 +63,8 @@ public class QuickAccessDialogTest {

private class TestQuickAccessDialog extends QuickAccessDialog {

private volatile String infoText;

public TestQuickAccessDialog(IWorkbenchWindow activeWorkbenchWindow, Command command) {
super(activeWorkbenchWindow, command);
}
Expand All @@ -71,6 +73,12 @@ public TestQuickAccessDialog(IWorkbenchWindow activeWorkbenchWindow, Command com
protected IDialogSettings getDialogSettings() {
return dialogSettings;
}

@Override
protected void setInfoText(String text) {
super.setInfoText(text);
infoText = text;
}
}

private static final int TIMEOUT = 5000;
Expand Down Expand Up @@ -294,17 +302,16 @@ private void activateCurrentElement(QuickAccessDialog dialog) {
@Test
public void testPreviousChoicesAvailableForExtension() {
// add one selection to history
QuickAccessDialog dialog = new TestQuickAccessDialog(activeWorkbenchWindow, null);
TestQuickAccessDialog dialog = new TestQuickAccessDialog(activeWorkbenchWindow, null);
Text text = dialog.getQuickAccessContents().getFilterText();
text.setText("initial test");
dialog.open();
/*
* wait for the initial dialog contents, to avoid race conditions later on in the test, see:
* wait for the dialog initialization, to avoid race conditions later on in the test, see:
* https://github.com/eclipse-platform/eclipse.platform.ui/issues/4009
*/
assertTrue(DisplayHelper.waitForCondition(text.getDisplay(), TIMEOUT,
() -> dialogContains(dialog, "initial test")),
"Unexpected dialog contents: " + getAllEntries(dialog.getQuickAccessContents().getTable()));
assertTrue(DisplayHelper.waitForCondition(text.getDisplay(), TIMEOUT * 1000,
() -> dialog.infoText != null),
"Unexpected dialog info: " + dialog.infoText);
text.setText(TestQuickAccessComputer.TEST_QUICK_ACCESS_PROPOSAL_LABEL);
final Table firstTable = dialog.getQuickAccessContents().getTable();
assertTrue(DisplayHelper.waitForCondition(text.getDisplay(), TIMEOUT,
Expand Down
Loading