8067441: Some tests fails with error: cannot find symbol getSystemMnemonicKeyCodes()
authoralexsch
Mon, 15 Dec 2014 19:21:00 +0300
changeset 28230 f488c331f610
parent 28229 15b31c9a2351
child 28231 b608ffcaed74
8067441: Some tests fails with error: cannot find symbol getSystemMnemonicKeyCodes() Reviewed-by: serb, azvegint
jdk/test/javax/swing/regtesthelpers/Util.java
--- a/jdk/test/javax/swing/regtesthelpers/Util.java	Mon Dec 15 16:00:53 2014 +0300
+++ b/jdk/test/javax/swing/regtesthelpers/Util.java	Mon Dec 15 19:21:00 2014 +0300
@@ -253,4 +253,18 @@
         }
         return result;
     }
+
+    /**
+     * Gets key codes from system mnemonic key mask
+     * @return key codes list
+     */
+    public static ArrayList<Integer> getSystemMnemonicKeyCodes() {
+        String osName = System.getProperty("os.name");
+        ArrayList<Integer> result = new ArrayList<>();
+        if (osName.contains("OS X")) {
+            result.add(KeyEvent.VK_CONTROL);
+        }
+        result.add(KeyEvent.ALT_MASK);
+        return result;
+    }
 }