Skip to content
Permalink
Browse files
8233634: [TESTBUG] Swing text test bug4278839.java fails on macos
Backport-of: 456fd90
  • Loading branch information
GoeLin committed Sep 22, 2021
1 parent 133de42 commit 0405d461580af89b9147ac7154b2d6ae2f842a58
Showing 2 changed files with 10 additions and 5 deletions.
@@ -788,7 +788,6 @@ javax/swing/text/StyledEditorKit/4506788/bug4506788.java 8233561 macosx-all
javax/swing/text/JTextComponent/6361367/bug6361367.java 8233569 macosx-all
javax/swing/text/html/HTMLEditorKit/5043626/bug5043626.java 233570 macosx-all
javax/swing/text/GlyphPainter2/6427244/bug6427244.java 8208566 macosx-all
javax/swing/text/DefaultEditorKit/4278839/bug4278839.java 8233634 macosx-all
javax/swing/ProgressMonitor/ProgressMonitorEscapeKeyPress.java 8233635 macosx-all
javax/swing/plaf/nimbus/TestNimbusOverride.java 8233559 macosx-all
javax/swing/JTree/4927934/bug4927934.java 8233550 macosx-all
@@ -24,7 +24,7 @@
/*
* @test
* @key headful
* @bug 4278839
* @bug 4278839 8233634
* @summary Incorrect cursor movement between words at the end of line
* @author Anton Nashatyrev
* @library ../../../regtesthelpers
@@ -41,12 +41,13 @@ public class bug4278839 extends JFrame {
private static boolean passed = true;
private static JTextArea area;
private static Robot robo;
private static JFrame frame;

public static void main(String[] args) {
public static void main(String[] args) throws Exception {
try {

robo = new Robot();
robo.setAutoDelay(100);
robo.setAutoDelay(200);

SwingUtilities.invokeAndWait(new Runnable() {
@Override
@@ -60,6 +61,7 @@ public void run() {
clickMouse();
robo.waitForIdle();

area.setCaretPosition(0);

if ("Aqua".equals(UIManager.getLookAndFeel().getID())) {
Util.hitKeys(robo, KeyEvent.VK_HOME);
@@ -86,6 +88,10 @@ public void run() {
} catch (Exception e) {
throw new RuntimeException("Test failed because of an exception:",
e);
} finally {
if (frame != null) {
SwingUtilities.invokeAndWait(() -> frame.dispose());
}
}

if (!passed) {
@@ -143,7 +149,7 @@ public static int getCtrlKey() {
}

private static void createAndShowGUI() {
JFrame frame = new JFrame();
frame = new JFrame();
frame.setTitle("Bug# 4278839");
frame.setSize(200, 200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

1 comment on commit 0405d46

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 0405d46 Sep 22, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.