< prev index next >

test/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,8 ---- /* ! * Copyright (c) 2006, 2013, 2016 Oracle and/or its affiliates. All rights ! * reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 21,31 **** * questions. */ /* test ! @bug 6380743 @summary Submenu should be shown by mnemonic key press. @author anton.tarasov@...: area=awt.focus @run applet SubMenuShowTest.html */ --- 22,32 ---- * questions. */ /* test ! @bug 6380743 8158380 @summary Submenu should be shown by mnemonic key press. @author anton.tarasov@...: area=awt.focus @run applet SubMenuShowTest.html */
*** 53,62 **** --- 54,65 ---- app.start(); } public void init() { robot = Util.createRobot(); + robot.setAutoDelay(200); + robot.setAutoWaitForIdle(true); // Create instructions for the user here, as well as set up // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ());
*** 83,121 **** } } }); frame.setVisible(true); - Util.waitForIdle(robot); boolean isMacOSX = (OSInfo.getOSType() == OSInfo.OSType.MACOSX); if (isMacOSX) { robot.keyPress(KeyEvent.VK_CONTROL); - robot.delay(20); } robot.keyPress(KeyEvent.VK_ALT); - robot.delay(20); robot.keyPress(KeyEvent.VK_F); - robot.delay(20); robot.keyRelease(KeyEvent.VK_F); - robot.delay(20); robot.keyRelease(KeyEvent.VK_ALT); if (isMacOSX) { robot.keyRelease(KeyEvent.VK_CONTROL); - robot.delay(20); } - Util.waitForIdle(robot); robot.keyPress(KeyEvent.VK_M); - robot.delay(20); robot.keyRelease(KeyEvent.VK_M); - Util.waitForIdle(robot); - robot.keyPress(KeyEvent.VK_SPACE); - robot.delay(20); robot.keyRelease(KeyEvent.VK_SPACE); - Util.waitForIdle(robot); if (!Util.waitForCondition(activated, 2000)) { throw new TestFailedException("a submenu wasn't activated by mnemonic key press"); } --- 86,113 ---- } } }); frame.setVisible(true); boolean isMacOSX = (OSInfo.getOSType() == OSInfo.OSType.MACOSX); if (isMacOSX) { robot.keyPress(KeyEvent.VK_CONTROL); } robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_F); robot.keyRelease(KeyEvent.VK_F); robot.keyRelease(KeyEvent.VK_ALT); + if (isMacOSX) { robot.keyRelease(KeyEvent.VK_CONTROL); } robot.keyPress(KeyEvent.VK_M); robot.keyRelease(KeyEvent.VK_M); robot.keyPress(KeyEvent.VK_SPACE); robot.keyRelease(KeyEvent.VK_SPACE); if (!Util.waitForCondition(activated, 2000)) { throw new TestFailedException("a submenu wasn't activated by mnemonic key press"); }
< prev index next >