8032568: Test javax/swing/JInternalFrame/8020708/bug8020708.java fails on Windows virtual hosts
authoralexsch
Thu, 10 Sep 2015 17:02:30 +0400
changeset 32676 8e861f233b25
parent 32675 1b2f76f1053d
child 32677 171c6332a2cd
8032568: Test javax/swing/JInternalFrame/8020708/bug8020708.java fails on Windows virtual hosts Reviewed-by: serb, alexsch Contributed-by: Rajeev Chamyal <rajeev.chamyal@oracle.com>
jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java
--- a/jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java	Wed Sep 09 19:10:38 2015 +0300
+++ b/jdk/test/javax/swing/JInternalFrame/8020708/bug8020708.java	Thu Sep 10 17:02:30 2015 +0400
@@ -35,7 +35,7 @@
 
 /**
  * @test
- * @bug 8020708
+ * @bug 8020708 8032568
  * @author Alexander Scherbatiy
  * @summary NLS: mnemonics missing in SwingSet2/JInternalFrame demo
  * @library ../../regtesthelpers
@@ -111,8 +111,14 @@
 
         Util.hitKeys(robot, KeyEvent.VK_CONTROL, KeyEvent.VK_SPACE);
         robot.waitForIdle();
-
-        Util.hitKeys(robot, KeyEvent.VK_C);
+        int keyCode = KeyEvent.VK_C;
+        String mnemonic = UIManager
+                .getString("InternalFrameTitlePane.closeButton.mnemonic");
+        try {
+            keyCode = Integer.parseInt(mnemonic);
+        } catch (NumberFormatException e) {
+        }
+        Util.hitKeys(robot, keyCode);
         robot.waitForIdle();
         robot.delay(500);