8198617: java/awt/Focus/6382144/EndlessLoopTest.java fails on mac
Reviewed-by: jdv, serb
This commit is contained in:
parent
0438cea65b
commit
ce48f04085
@ -195,7 +195,6 @@ java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java 8073636 macosx-a
|
|||||||
java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all,linux-all
|
java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all,linux-all
|
||||||
java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all
|
java/awt/Focus/8013611/JDK8013611.java 8175366 windows-all,macosx-all
|
||||||
java/awt/Focus/6378278/InputVerifierTest.java 8198616 macosx-all
|
java/awt/Focus/6378278/InputVerifierTest.java 8198616 macosx-all
|
||||||
java/awt/Focus/6382144/EndlessLoopTest.java 8198617 macosx-all
|
|
||||||
java/awt/Focus/6981400/Test1.java 8029675 windows-all,macosx-all
|
java/awt/Focus/6981400/Test1.java 8029675 windows-all,macosx-all
|
||||||
java/awt/Focus/6981400/Test3.java 8173264 generic-all
|
java/awt/Focus/6981400/Test3.java 8173264 generic-all
|
||||||
java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all,macosx-all
|
java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java 8169476 windows-all,macosx-all
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -26,7 +26,6 @@
|
|||||||
@key headful
|
@key headful
|
||||||
@bug 6382144
|
@bug 6382144
|
||||||
@summary REGRESSION: InputVerifier and JOptionPane
|
@summary REGRESSION: InputVerifier and JOptionPane
|
||||||
@author oleg.sukhodolsky: area=awt.focus
|
|
||||||
@run main EndlessLoopTest
|
@run main EndlessLoopTest
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -57,30 +56,36 @@ import javax.swing.JComponent;
|
|||||||
import javax.swing.JDialog;
|
import javax.swing.JDialog;
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
import javax.swing.JTextField;
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
public class EndlessLoopTest
|
public class EndlessLoopTest
|
||||||
{
|
{
|
||||||
|
|
||||||
//*** test-writer defined static variables go here ***
|
//*** test-writer defined static variables go here ***
|
||||||
static volatile int n_iv_calls;
|
static volatile int n_iv_calls;
|
||||||
|
static JFrame frame;
|
||||||
|
static JTextField t1;
|
||||||
|
static JButton button;
|
||||||
|
|
||||||
|
private static void init() throws Exception
|
||||||
private static void init()
|
|
||||||
{
|
{
|
||||||
//*** Create instructions for the user here ***
|
//*** Create instructions for the user here ***
|
||||||
|
|
||||||
JFrame frame = new JFrame();
|
try {
|
||||||
|
SwingUtilities.invokeAndWait(() -> {
|
||||||
|
frame = new JFrame();
|
||||||
final JDialog dialog = new JDialog(frame, true);
|
final JDialog dialog = new JDialog(frame, true);
|
||||||
JButton button = new JButton("press me");
|
button = new JButton("press me");
|
||||||
button.addActionListener(new ActionListener() {
|
button.addActionListener(new ActionListener() {
|
||||||
public void actionPerformed(ActionEvent ae) {
|
public void actionPerformed(ActionEvent ae) {
|
||||||
dialog.dispose();
|
dialog.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialog.getContentPane().add(button);
|
dialog.getContentPane().add(button);
|
||||||
|
dialog.setLocationRelativeTo(null);
|
||||||
dialog.pack();
|
dialog.pack();
|
||||||
|
|
||||||
JTextField t1 = new JTextField();
|
t1 = new JTextField();
|
||||||
t1.setInputVerifier(new InputVerifier() {
|
t1.setInputVerifier(new InputVerifier() {
|
||||||
public boolean verify(JComponent input) {
|
public boolean verify(JComponent input) {
|
||||||
n_iv_calls++;
|
n_iv_calls++;
|
||||||
@ -92,11 +97,12 @@ public class EndlessLoopTest
|
|||||||
});
|
});
|
||||||
JTextField t2 = new JTextField();
|
JTextField t2 = new JTextField();
|
||||||
|
|
||||||
|
|
||||||
frame.getContentPane().add(t1, BorderLayout.NORTH);
|
frame.getContentPane().add(t1, BorderLayout.NORTH);
|
||||||
frame.getContentPane().add(t2, BorderLayout.SOUTH);
|
frame.getContentPane().add(t2, BorderLayout.SOUTH);
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
frame.setSize(200, 200);
|
frame.setSize(200, 200);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
|
});
|
||||||
|
|
||||||
Robot r = null;
|
Robot r = null;
|
||||||
try {
|
try {
|
||||||
@ -106,7 +112,9 @@ public class EndlessLoopTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
r.setAutoDelay(100);
|
||||||
r.waitForIdle();
|
r.waitForIdle();
|
||||||
|
r.delay(1000);
|
||||||
|
|
||||||
mouseClickOnComp(r, t1);
|
mouseClickOnComp(r, t1);
|
||||||
r.waitForIdle();
|
r.waitForIdle();
|
||||||
@ -116,7 +124,6 @@ public class EndlessLoopTest
|
|||||||
}
|
}
|
||||||
n_iv_calls = 0;
|
n_iv_calls = 0;
|
||||||
r.keyPress(KeyEvent.VK_TAB);
|
r.keyPress(KeyEvent.VK_TAB);
|
||||||
r.delay(10);
|
|
||||||
r.keyRelease(KeyEvent.VK_TAB);
|
r.keyRelease(KeyEvent.VK_TAB);
|
||||||
r.waitForIdle();
|
r.waitForIdle();
|
||||||
|
|
||||||
@ -131,7 +138,13 @@ public class EndlessLoopTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
EndlessLoopTest.pass();
|
EndlessLoopTest.pass();
|
||||||
|
} finally {
|
||||||
|
SwingUtilities.invokeAndWait(() -> {
|
||||||
|
if (frame != null) {
|
||||||
|
frame.dispose();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}//End init()
|
}//End init()
|
||||||
|
|
||||||
|
|
||||||
@ -140,10 +153,9 @@ public class EndlessLoopTest
|
|||||||
loc.x += comp.getWidth() / 2;
|
loc.x += comp.getWidth() / 2;
|
||||||
loc.y += comp.getHeight() / 2;
|
loc.y += comp.getHeight() / 2;
|
||||||
r.mouseMove(loc.x, loc.y);
|
r.mouseMove(loc.x, loc.y);
|
||||||
r.delay(10);
|
r.waitForIdle();
|
||||||
r.mousePress(InputEvent.BUTTON1_MASK);
|
r.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||||
r.delay(10);
|
r.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||||
r.mouseRelease(InputEvent.BUTTON1_MASK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
@ -170,7 +182,7 @@ public class EndlessLoopTest
|
|||||||
// instantiated in the same VM. Being static (and using
|
// instantiated in the same VM. Being static (and using
|
||||||
// static vars), it aint gonna work. Not worrying about
|
// static vars), it aint gonna work. Not worrying about
|
||||||
// it for now.
|
// it for now.
|
||||||
public static void main( String args[] ) throws InterruptedException
|
public static void main( String args[] ) throws Exception
|
||||||
{
|
{
|
||||||
mainThread = Thread.currentThread();
|
mainThread = Thread.currentThread();
|
||||||
try
|
try
|
||||||
|
Loading…
x
Reference in New Issue
Block a user