Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8233567: [TESTBUG] FocusSubRequestTest.java fails on macos #3430

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -521,7 +521,6 @@ java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java 8233564 macosx-all
java/awt/Modal/NullModalityDialogTest/NullModalityDialogTest.java 8233565 macosx-all
java/awt/keyboard/AllKeyCode/AllKeyCode.java 8242930 macosx-all
java/awt/FullScreen/8013581/bug8013581.java 8169471 macosx-all
java/awt/Focus/FocusSubRequestTest/FocusSubRequestTest.java 8233567 macosx-all
java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java 8233568 macosx-all
java/awt/event/MouseEvent/MultipleMouseButtonsTest/MultipleMouseButtonsTest.java 8233568 macosx-all
java/awt/event/MouseEvent/ClickDuringKeypress/ClickDuringKeypress.java 8233568 macosx-all
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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
@@ -62,6 +62,7 @@ public void keyPressed(KeyEvent e) {

try {
robot = new Robot();
robot.setAutoDelay(100);
} catch(Exception e) {
throw new RuntimeException("Error: unable to create robot", e);
}
@@ -77,7 +78,6 @@ public void start() {

robot.delay(100);
robot.keyPress(KeyEvent.VK_K);
robot.delay(100);
robot.keyRelease(KeyEvent.VK_K);

robot.waitForIdle();
@@ -90,14 +90,16 @@ public void start() {
}

private void waitTillShown(Component component) {
while (true) {
Point p = null;
while (p == null) {
try {
Thread.sleep(100);
component.getLocationOnScreen();
break;
} catch(InterruptedException ie) {
throw new RuntimeException(ie);
} catch(IllegalComponentStateException icse) {}
p = component.getLocationOnScreen();
} catch (IllegalStateException e) {
try {
Thread.sleep(500);
} catch (InterruptedException ie) {
}
}
}
}
}