Skip to content

Commit

Permalink
8233570: [TESTBUG] HTMLEditorKit test bug5043626.java is failing on m…
Browse files Browse the repository at this point in the history
…acos

Reviewed-by: serb
  • Loading branch information
prsadhuk committed Oct 29, 2020
1 parent 7e305ad commit a5b42ec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,6 @@ javax/swing/ToolTipManager/Test6256140.java 8233560 macosx-all
javax/swing/text/View/8014863/bug8014863.java 8233561 macosx-all
javax/swing/text/StyledEditorKit/4506788/bug4506788.java 8233562 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/JRootPane/4670486/bug4670486.java 8042381 macosx-all
javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java 8233555 macosx-all
javax/swing/JRadioButton/8075609/bug8075609.java 8233555 macosx-all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
* @key headful
* @bug 5043626
* @summary Tests pressing Home or Ctrl+Home set cursor to invisible element <head>
* @author Alexander Potochkin
* @library ../../../../regtesthelpers
* @build Util
* @run main bug5043626
*/

Expand All @@ -43,38 +40,51 @@ public class bug5043626 {

private static Document doc;
private static Robot robot;
private static JFrame frame;

public static void main(String[] args) throws Exception {
robot = new Robot();
try {
robot = new Robot();
robot.setAutoDelay(100);

SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
createAndShowGUI();
}
});

robot.waitForIdle();
robot.waitForIdle();
robot.delay(1000);

Util.hitKeys(robot, KeyEvent.VK_HOME);
Util.hitKeys(robot, KeyEvent.VK_1);
robot.keyPress(KeyEvent.VK_HOME);
robot.keyRelease(KeyEvent.VK_HOME);
robot.keyPress(KeyEvent.VK_1);
robot.keyRelease(KeyEvent.VK_1);

robot.waitForIdle();
robot.waitForIdle();

String test = getText();
String test = getText();

if (!"1test".equals(test)) {
throw new RuntimeException("Begin line action set cursor inside <head> tag");
}
if (!"1test".equals(test)) {
throw new RuntimeException("Begin line action set cursor inside <head> tag");
}

Util.hitKeys(robot, KeyEvent.VK_HOME);
Util.hitKeys(robot, KeyEvent.VK_2);
robot.keyPress(KeyEvent.VK_HOME);
robot.keyRelease(KeyEvent.VK_HOME);
robot.keyPress(KeyEvent.VK_2);
robot.keyRelease(KeyEvent.VK_2);

robot.waitForIdle();
robot.waitForIdle();

test = getText();
test = getText();

if (!"21test".equals(test)) {
throw new RuntimeException("Begin action set cursor inside <head> tag");
if (!"21test".equals(test)) {
throw new RuntimeException("Begin action set cursor inside <head> tag");
}
} finally {
if (frame != null) {
SwingUtilities.invokeAndWait(frame::dispose);
}
}
}

Expand All @@ -95,7 +105,7 @@ public void run() {
}

private static void createAndShowGUI() {
JFrame frame = new JFrame();
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JEditorPane editorPane = new JEditorPane();
Expand All @@ -104,6 +114,7 @@ private static void createAndShowGUI() {
editorPane.setEditable(true);
frame.add(editorPane);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
doc = editorPane.getDocument();
editorPane.setCaretPosition(doc.getLength());
Expand Down

5 comments on commit a5b42ec

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on a5b42ec Oct 29, 2020

Choose a reason for hiding this comment

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

@RealCLanger
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 a5b42ec Oct 31, 2021

Choose a reason for hiding this comment

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

@RealCLanger Could not automatically backport a5b42ec8 to openjdk/jdk11u-dev due to conflicts in the following files:

  • test/jdk/ProblemList.txt

To manually resolve these conflicts run the following commands in your personal fork of openjdk/jdk11u-dev:

$ git checkout -b RealCLanger-backport-a5b42ec8
$ git fetch --no-tags https://git.openjdk.java.net/jdk a5b42ec8b29249814dda28e751ee363869e98da0
$ git cherry-pick --no-commit a5b42ec8b29249814dda28e751ee363869e98da0
$ # Resolve conflicts
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport a5b42ec8b29249814dda28e751ee363869e98da0'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk11u-dev with the title Backport a5b42ec8b29249814dda28e751ee363869e98da0.

@mrserb
Copy link
Member

@mrserb mrserb commented on a5b42ec Jan 27, 2023

Choose a reason for hiding this comment

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

/backport jdk8u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on a5b42ec Jan 27, 2023

Choose a reason for hiding this comment

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

@mrserb Could not automatically backport a5b42ec8 to openjdk/jdk8u-dev due to conflicts in the following files:

  • test/jdk/ProblemList.txt

Please fetch the appropriate branch/commit and manually resolve these conflicts by using the following commands in your personal fork of openjdk/jdk8u-dev. Note: these commands are just some suggestions and you can use other equivalent commands you know.

# Fetch the up-to-date version of the target branch
$ git fetch --no-tags https://git.openjdk.org/jdk8u-dev master:master

# Check out the target branch and create your own branch to backport
$ git checkout master
$ git checkout -b mrserb-backport-a5b42ec8

# Fetch the commit you want to backport
$ git fetch --no-tags https://git.openjdk.org/jdk a5b42ec8b29249814dda28e751ee363869e98da0

# Backport the commit
$ git cherry-pick --no-commit a5b42ec8b29249814dda28e751ee363869e98da0
# Resolve conflicts now

# Commit the files you have modified
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport a5b42ec8b29249814dda28e751ee363869e98da0'

Once you have resolved the conflicts as explained above continue with creating a pull request towards the openjdk/jdk8u-dev with the title Backport a5b42ec8b29249814dda28e751ee363869e98da0.

Please sign in to comment.