< prev index next >
test/jdk/java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java
Print this page
rev 51542 : 8210039: move OSInfo to top level testlibrary
Reviewed-by: duke
*** 36,56 ****
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.WindowConstants;
! import jdk.testlibrary.OSInfo;
/**
* @test
* @key headful
* @bug 5028014
* @summary Focus request & mouse click being performed nearly synchronously
* shouldn't break the focus subsystem
* @author anton.tarasov@sun.com: area=awt-focus
! * @library ../../../../lib/testlibrary
! * @build jdk.testlibrary.OSInfo
* @run main MouseClickRequestFocusRaceTest
*/
public class MouseClickRequestFocusRaceTest {
static Robot robot;
static JFrame frame1 = new JFrame("Frame-1") {
--- 36,56 ----
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.WindowConstants;
! import jdk.test.lib.Platform;
/**
* @test
* @key headful
* @bug 5028014
* @summary Focus request & mouse click being performed nearly synchronously
* shouldn't break the focus subsystem
* @author anton.tarasov@sun.com: area=awt-focus
! * @library /test/lib
! * @build jdk.test.lib.Platform
* @run main MouseClickRequestFocusRaceTest
*/
public class MouseClickRequestFocusRaceTest {
static Robot robot;
static JFrame frame1 = new JFrame("Frame-1") {
*** 147,157 ****
// Verify that the focused window is the ancestor of the focus owner
if (!focusedWindow.isAncestorOf(focusOwner)) {
throw new RuntimeException("The focus owner is not in the focused window!");
}
! if (!OSInfo.getOSType().equals(OSInfo.OSType.MACOSX)) {
// Try to close native focused window
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_F4);
robot.keyRelease(KeyEvent.VK_F4);
robot.keyRelease(KeyEvent.VK_ALT);
--- 147,157 ----
// Verify that the focused window is the ancestor of the focus owner
if (!focusedWindow.isAncestorOf(focusOwner)) {
throw new RuntimeException("The focus owner is not in the focused window!");
}
! if (!Platform.isOSX()) {
// Try to close native focused window
robot.keyPress(KeyEvent.VK_ALT);
robot.keyPress(KeyEvent.VK_F4);
robot.keyRelease(KeyEvent.VK_F4);
robot.keyRelease(KeyEvent.VK_ALT);
< prev index next >