JBR-3642 java/awt/Window/8159168/SetShapeTest.java fails on macOS-x64 & macOS-aarch64

make sure jb/java/awt/Focus/Typeahead* tests still pass

includes fixes for JBR-3786 javax/swing/plaf/aqua/CustomComboBoxFocusTest.java fails on MacOS by timeout
(cherry picked from commit f5c5388fb5)

and JBR-4113 java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java fails by time out on macOS

(cherry picked from commit d8d4c55a61)
This commit is contained in:
Dmitry Batrak
2021-07-28 18:14:57 +03:00
committed by jbrbot
parent bedb045e65
commit 3b0cfd52bb
4 changed files with 20 additions and 23 deletions

View File

@@ -930,7 +930,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
int result = LWKeyboardFocusManagerPeer.shouldNativelyFocusHeavyweight(
getTarget(), lightweightChild, temporary,
focusedWindowChangeAllowed, time, cause, false);
focusedWindowChangeAllowed, time, cause, true);
switch (result) {
case LWKeyboardFocusManagerPeer.SNFH_FAILURE:
return false;
@@ -984,7 +984,7 @@ public abstract class LWComponentPeer<T extends Component, D extends JComponent>
KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
Component focusOwner = kfmPeer.getCurrentFocusOwner();
return LWKeyboardFocusManagerPeer.deliverFocus(lightweightChild,
getTarget(), false, cause, focusOwner);
getTarget(), true, cause, focusOwner);
case LWKeyboardFocusManagerPeer.SNFH_SUCCESS_HANDLED:
return true;

View File

@@ -1416,7 +1416,7 @@ public class LWWindowPeer
WindowEvent windowEvent = new TimedWindowEvent(getTarget(), eventID, opposite, System.currentTimeMillis());
// TODO: wrap in SequencedEvent
postEvent(windowEvent);
SunToolkit.postPriorityEvent(windowEvent);
}
/*

View File

@@ -116,15 +116,6 @@ public class TestDialogTypeAhead {
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.err.println("B pressed");
EventQueue.invokeLater(new Runnable() {
public void run() {
waitTillShown(d);
TestDialogTypeAhead.this.d.toFront();
TestDialogTypeAhead.this.moveMouseOver(d);
}
});
d.setVisible(true);
}
});
@@ -152,6 +143,9 @@ public class TestDialogTypeAhead {
robot.keyPress(KeyEvent.VK_SPACE);
robot.keyRelease(KeyEvent.VK_SPACE);
waitTillShown(d);
d.toFront();
moveMouseOver(d);
try {
robotSema.doWait(1000);

View File

@@ -257,20 +257,23 @@ public class CustomComboBoxFocusTest {
System.out.println("Request focus on " + target);
final Component c = target.getEditor().getEditorComponent();
c.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
SwingUtilities.invokeLater(focusHandler);
}
if (c.isFocusOwner()) {
SwingUtilities.invokeLater(focusHandler);
} else {
c.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
SwingUtilities.invokeLater(focusHandler);
}
@Override
public void focusLost(FocusEvent e) {
@Override
public void focusLost(FocusEvent e) {
}
});
c.requestFocus();
}
});
c.requestFocus();
}
}
public Step nextStep() {