Skip to content

Commit

Permalink
8233567: [TESTBUG] FocusSubRequestTest.java fails on macos
Browse files Browse the repository at this point in the history
Reviewed-by: azvegint, pbansal
  • Loading branch information
prsadhuk committed Apr 12, 2021
1 parent 125184e commit b90ad76
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
}
Expand All @@ -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();
Expand All @@ -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) {
}
}
}
}
}

3 comments on commit b90ad76

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheRealMDoerr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on b90ad76 Oct 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheRealMDoerr @TheRealMDoerr the backport was successfully created on the branch TheRealMDoerr-backport-b90ad76d in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

this pull request contains a backport of commit b90ad76d from the openjdk/jdk repository.

The commit being backported was authored by Prasanta Sadhukhan on 12 Apr 2021 and was reviewed by Alexander Zvegintsev and Pankaj Bansal.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev TheRealMDoerr-backport-b90ad76d:TheRealMDoerr-backport-b90ad76d
$ git checkout TheRealMDoerr-backport-b90ad76d
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev TheRealMDoerr-backport-b90ad76d

Please sign in to comment.