Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-06-22 22:18:30 +0000
committerMatthias Sohn2015-06-26 07:45:54 +0000
commit5fd0eb636d627b2c80ef7e5ae690769047d48964 (patch)
tree3e2ce6090a6185b3194af813268821bef8591084 /org.eclipse.egit.ui.test/src/org/eclipse/egit
parent215c1e10dfbd33a1370e61d4b95c9a1657ac4f47 (diff)
downloadegit-5fd0eb636d627b2c80ef7e5ae690769047d48964.tar.gz
egit-5fd0eb636d627b2c80ef7e5ae690769047d48964.tar.xz
egit-5fd0eb636d627b2c80ef7e5ae690769047d48964.zip
Make sure widget is focused and UI events are processed before clicking
Trying to make tests which cannot find active shell more stable Change-Id: I0c7964da106e2c965accfa727eedb3b7cc9e38fe Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java
index cf043e893e..0f12bdc1bb 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/ContextMenuHelper.java
@@ -110,6 +110,10 @@ public class ContextMenuHelper {
private static void clickContextMenuInternal(final AbstractSWTBot<?> bot,
final boolean sync, final String... texts) {
+ // set focus on current widget and let the UI process events
+ bot.setFocus();
+ TestUtil.processUIEvents();
+
// show
final MenuItem menuItem = UIThreadRunnable
.syncExec(new WidgetResult<MenuItem>() {

Back to the top