mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 10:34:38 +02:00
8198621: java/awt/Focus/KeyEventForBadFocusOwnerTest/KeyEventForBadFocusOwnerTest.java fails on mac
Reviewed-by: serb
This commit is contained in:
parent
7b609a2016
commit
6e5026a8df
2 changed files with 87 additions and 77 deletions
|
@ -133,7 +133,6 @@ java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all,macosx-all
|
|||
java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-all
|
||||
java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252 macosx-all
|
||||
java/awt/Focus/FocusTraversalPolicy/ButtonGroupLayoutTraversal/ButtonGroupLayoutTraversalTest.java 8198619 macosx-all
|
||||
java/awt/Focus/KeyEventForBadFocusOwnerTest/KeyEventForBadFocusOwnerTest.java 8198621 macosx-all
|
||||
java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java 8194753 linux-all,macosx-all
|
||||
java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest.java 7152980 macosx-all
|
||||
java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java 8159599 macosx-all
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2021, 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
|
||||
|
@ -54,11 +54,13 @@ public class KeyEventForBadFocusOwnerTest {
|
|||
volatile static boolean unexpectedItemSelected = false;
|
||||
|
||||
static Robot robot;
|
||||
static JFrame frame;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
public void run() {
|
||||
JFrame frame = new JFrame("TEST");
|
||||
frame = new JFrame("TEST");
|
||||
JMenuBar mb = new JMenuBar();
|
||||
JMenu one = new JMenu(ITEM_ONE_TEXT);
|
||||
JMenu two = new JMenu(ITEM_TWO_TEXT);
|
||||
|
@ -115,6 +117,7 @@ public class KeyEventForBadFocusOwnerTest {
|
|||
frame.setJMenuBar(mb);
|
||||
frame.setSize(100,100);
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
@ -124,6 +127,7 @@ public class KeyEventForBadFocusOwnerTest {
|
|||
robot = new Robot();
|
||||
robot.setAutoDelay(100);
|
||||
robot.waitForIdle();
|
||||
robot.delay(1000);
|
||||
|
||||
Util.hitMnemonics(robot, KeyEvent.VK_O);
|
||||
Util.hitMnemonics(robot, KeyEvent.VK_T);
|
||||
|
@ -137,5 +141,12 @@ public class KeyEventForBadFocusOwnerTest {
|
|||
if (!itemOneSelected || !itemTwoSelected) {
|
||||
throw new Exception("Not all expected events were received");
|
||||
}
|
||||
} finally {
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
if (frame != null) {
|
||||
frame.dispose();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue