Author: vpakan(a)redhat.com
Date: 2011-08-30 14:28:21 -0400 (Tue, 30 Aug 2011)
New Revision: 34403
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java
Log:
Fixes related to changes regarding MacOs
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2011-08-30
18:28:08 UTC (rev 34402)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/helper/ContextMenuHelper.java 2011-08-30
18:28:21 UTC (rev 34403)
@@ -41,6 +41,7 @@
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
import org.hamcrest.Matcher;
+import org.jboss.tools.ui.bot.ext.SWTJBTExt;
/**
* Helper to find context menu of widget
@@ -149,18 +150,28 @@
*/
private static void hide(final Menu menu , boolean hideRecursively) {
if (menu != null){
- // Hide recursively
- if (hideRecursively) {
- KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_ESCAPE);
- }
- else{
- menu.notifyListeners(SWT.Hide, new Event());
- }
+ menu.notifyListeners(SWT.Hide, new Event());
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
- }
+ }
+ // Hide recursively
+ if (hideRecursively) {
+ if (SWTJBTExt.isRunningOnMacOs()){
+ KeyboardHelper.typeKeyCodeUsingAWT(KeyEvent.VK_ESCAPE);
+ try {
+ Thread.sleep(100);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ else{
+ if (menu.getParentMenu() != null) {
+ hide(menu.getParentMenu(),hideRecursively);
+ }
+ }
+ }
}
}
/**
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2011-08-30
18:28:08 UTC (rev 34402)
+++
trunk/vpe/tests/org.jboss.tools.vpe.ui.bot.test/src/org/jboss/tools/vpe/ui/bot/test/tools/SWTBotWebBrowser.java 2011-08-30
18:28:21 UTC (rev 34403)
@@ -661,9 +661,8 @@
}
menusHolder = parent;
}
-
try {
- Menu[] menus = ReflectionsHelper.getPrivateFieldValue(menusHolder.getClass(),
+ Menu[] menus =
ReflectionsHelper.getPrivateFieldValue(SWTJBTExt.isRunningOnMacOs() ? Display.class :
Decorations.class,
"menus",
menusHolder,
Menu[].class);