mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-12 06:29:37 +00:00
8260035: Deproblemlist few problemlisted test
Reviewed-by: jdv
This commit is contained in:
parent
5940287b9f
commit
7f7166dbc8
@ -744,7 +744,6 @@ javax/swing/JPopupMenu/6800513/bug6800513.java 7184956 macosx-all
|
||||
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
|
||||
javax/swing/JTabbedPane/4624207/bug4624207.java 8064922 macosx-all
|
||||
javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all
|
||||
javax/swing/plaf/basic/Test6984643.java 8198340 windows-all
|
||||
javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java 8194048 windows-all
|
||||
javax/swing/text/DefaultCaret/HidingSelection/MultiSelectionTest.java 8213562 linux-all
|
||||
javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
|
||||
@ -757,10 +756,8 @@ javax/swing/UIDefaults/6302464/bug6302464.java 8199079 macosx-all
|
||||
javax/swing/dnd/8139050/NativeErrorsInTableDnD.java 8202765 macosx-all,linux-all
|
||||
javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all
|
||||
javax/swing/JEditorPane/6917744/bug6917744.java 8213124 macosx-all
|
||||
javax/swing/JTree/6263446/bug6263446.java 8213125 macosx-all
|
||||
javax/swing/JRootPane/4670486/bug4670486.java 8042381 macosx-all
|
||||
javax/swing/JPopupMenu/4634626/bug4634626.java 8017175 macosx-all
|
||||
javax/swing/JMenuItem/6249972/bug6249972.java 8233640 macosx-all
|
||||
|
||||
sanity/client/SwingSet/src/ToolTipDemoTest.java 8225012 windows-all,macosx-all
|
||||
sanity/client/SwingSet/src/ScrollPaneDemoTest.java 8225013 linux-all
|
||||
|
||||
@ -26,8 +26,6 @@
|
||||
* @key headful
|
||||
* @bug 6249972
|
||||
* @summary Tests that JMenuItem(String,int) handles lower-case mnemonics properly.
|
||||
* @library /lib/client
|
||||
* @build ExtendedRobot
|
||||
* @author Mikhail Lapshin
|
||||
* @run main bug6249972
|
||||
*/
|
||||
@ -36,61 +34,76 @@ import javax.swing.*;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Point;
|
||||
import java.awt.Robot;
|
||||
|
||||
public class bug6249972 implements ActionListener {
|
||||
|
||||
|
||||
private JFrame frame;
|
||||
private static JFrame frame;
|
||||
private static Robot robot;
|
||||
private JMenu menu;
|
||||
private volatile boolean testPassed = false;
|
||||
private volatile Point p = null;
|
||||
private volatile Dimension size = null;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
bug6249972 bugTest = new bug6249972();
|
||||
bugTest.test();
|
||||
try {
|
||||
robot = new Robot();
|
||||
robot.setAutoDelay(100);
|
||||
bug6249972 bugTest = new bug6249972();
|
||||
robot.waitForIdle();
|
||||
robot.delay(1000);
|
||||
bugTest.test();
|
||||
} finally {
|
||||
if (frame != null) {
|
||||
SwingUtilities.invokeAndWait(() -> frame.dispose());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bug6249972() throws Exception {
|
||||
SwingUtilities.invokeAndWait(
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
frame = new JFrame("bug6249972");
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
frame = new JFrame("bug6249972");
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
JMenuBar bar = new JMenuBar();
|
||||
frame.setJMenuBar(bar);
|
||||
JMenuBar bar = new JMenuBar();
|
||||
frame.setJMenuBar(bar);
|
||||
|
||||
menu = new JMenu("Problem");
|
||||
bar.add(menu);
|
||||
menu = new JMenu("Problem");
|
||||
bar.add(menu);
|
||||
|
||||
JMenuItem item = new JMenuItem("JMenuItem(String,'z')", 'z');
|
||||
item.addActionListener(bug6249972.this);
|
||||
menu.add(item);
|
||||
JMenuItem item = new JMenuItem("JMenuItem(String,'z')", 'z');
|
||||
item.addActionListener(bug6249972.this);
|
||||
menu.add(item);
|
||||
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
||||
);
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void test() throws Exception {
|
||||
ExtendedRobot robot = new ExtendedRobot();
|
||||
robot.waitForIdle();
|
||||
java.awt.Point p = menu.getLocationOnScreen();
|
||||
java.awt.Dimension size = menu.getSize();
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
p = menu.getLocationOnScreen();
|
||||
size = menu.getSize();
|
||||
});
|
||||
p.x += size.width / 2;
|
||||
p.y += size.height / 2;
|
||||
robot.mouseMove(p.x, p.y);
|
||||
robot.click();
|
||||
robot.waitForIdle();
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
|
||||
robot.waitForIdle();
|
||||
robot.delay(100);
|
||||
robot.keyPress(KeyEvent.VK_Z);
|
||||
robot.keyRelease(KeyEvent.VK_Z);
|
||||
|
||||
robot.waitForIdle();
|
||||
robot.type(KeyEvent.VK_Z);
|
||||
|
||||
robot.waitForIdle();
|
||||
frame.dispose(); // Try to stop the event dispatch thread
|
||||
robot.delay(1000);
|
||||
|
||||
if (!testPassed) {
|
||||
throw new RuntimeException("JMenuItem(String,int) does not handle " +
|
||||
|
||||
@ -43,83 +43,92 @@ public class bug6263446 {
|
||||
private static final String ALL = FIRST + " " + SECOND;
|
||||
private static JTree tree;
|
||||
private static Robot robot;
|
||||
private static JFrame frame;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
robot = new Robot();
|
||||
robot.setAutoDelay(50);
|
||||
robot.setAutoDelay(100);
|
||||
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
createAndShowGUI();
|
||||
}
|
||||
});
|
||||
|
||||
robot.waitForIdle();
|
||||
robot.delay(1000);
|
||||
|
||||
Point point = getClickPoint();
|
||||
robot.mouseMove(point.x, point.y);
|
||||
try {
|
||||
Point point = getClickPoint();
|
||||
robot.mouseMove(point.x, point.y);
|
||||
|
||||
// click count 3
|
||||
click(1);
|
||||
assertNotEditing();
|
||||
// click count 3
|
||||
click(1);
|
||||
assertNotEditing();
|
||||
|
||||
click(2);
|
||||
assertNotEditing();
|
||||
click(2);
|
||||
assertNotEditing();
|
||||
|
||||
click(3);
|
||||
assertEditing();
|
||||
cancelCellEditing();
|
||||
assertNotEditing();
|
||||
click(3);
|
||||
assertEditing();
|
||||
cancelCellEditing();
|
||||
assertNotEditing();
|
||||
|
||||
click(4);
|
||||
checkSelectedText(FIRST);
|
||||
click(4);
|
||||
checkSelectedText(FIRST);
|
||||
|
||||
click(5);
|
||||
checkSelectedText(ALL);
|
||||
click(5);
|
||||
checkSelectedText(ALL);
|
||||
|
||||
// click count 4
|
||||
setClickCountToStart(4);
|
||||
// click count 4
|
||||
setClickCountToStart(4);
|
||||
|
||||
click(1);
|
||||
assertNotEditing();
|
||||
click(1);
|
||||
assertNotEditing();
|
||||
|
||||
click(2);
|
||||
assertNotEditing();
|
||||
click(2);
|
||||
assertNotEditing();
|
||||
|
||||
click(3);
|
||||
assertNotEditing();
|
||||
click(3);
|
||||
assertNotEditing();
|
||||
|
||||
click(4);
|
||||
assertEditing();
|
||||
cancelCellEditing();
|
||||
assertNotEditing();
|
||||
click(4);
|
||||
assertEditing();
|
||||
cancelCellEditing();
|
||||
assertNotEditing();
|
||||
|
||||
click(5);
|
||||
checkSelectedText(FIRST);
|
||||
click(5);
|
||||
checkSelectedText(FIRST);
|
||||
|
||||
click(6);
|
||||
checkSelectedText(ALL);
|
||||
click(6);
|
||||
checkSelectedText(ALL);
|
||||
|
||||
// start path editing
|
||||
startPathEditing();
|
||||
assertEditing();
|
||||
// start path editing
|
||||
startPathEditing();
|
||||
assertEditing();
|
||||
|
||||
click(1);
|
||||
checkSelection(null);
|
||||
click(1);
|
||||
checkSelection(null);
|
||||
|
||||
click(2);
|
||||
checkSelection(FIRST);
|
||||
click(2);
|
||||
checkSelection(FIRST);
|
||||
|
||||
click(3);
|
||||
checkSelection(ALL);
|
||||
click(3);
|
||||
checkSelection(ALL);
|
||||
} finally {
|
||||
if (frame != null) {
|
||||
SwingUtilities.invokeAndWait(() -> frame.dispose());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void click(int times) {
|
||||
robot.delay(500);
|
||||
for (int i = 0; i < times; i++) {
|
||||
robot.mousePress(InputEvent.BUTTON1_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_MASK);
|
||||
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
|
||||
robot.waitForIdle();
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,7 +157,7 @@ public class bug6263446 {
|
||||
|
||||
private static void createAndShowGUI() {
|
||||
|
||||
JFrame frame = new JFrame();
|
||||
frame = new JFrame();
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
tree = new JTree(createTreeModel());
|
||||
@ -158,6 +167,7 @@ public class bug6263446 {
|
||||
|
||||
frame.getContentPane().add(tree);
|
||||
frame.pack();
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ public class Test6984643 {
|
||||
}
|
||||
});
|
||||
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
public void run() {
|
||||
new JFileChooser();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user