Skip to content

Commit

Permalink
7151826: [TEST_BUG] [macosx] The test javax/swing/JPopupMenu/4966112/…
Browse files Browse the repository at this point in the history
…bug4966112.java not for mac

Reviewed-by: serb, jdv
  • Loading branch information
trebari authored and jayathirthrao committed Sep 30, 2020
1 parent 1eca634 commit 4d9f207
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,6 @@ javax/swing/JFileChooser/8062561/bug8062561.java 8196466 linux-all,macosx-all
javax/swing/JInternalFrame/Test6325652.java 8224977 macosx-all
javax/swing/JInternalFrame/8146321/JInternalFrameIconTest.java 8225045 linux-all
javax/swing/JPopupMenu/4870644/bug4870644.java 8194130 macosx-all,linux-all
javax/swing/JPopupMenu/4966112/bug4966112.java 8064915 macosx-all
javax/swing/MultiUIDefaults/Test6860438.java 8198391 generic-all
javax/swing/UITest/UITest.java 8198392 generic-all
javax/swing/plaf/basic/BasicComboBoxEditor/Test8015336.java 8198394 generic-all
Expand Down
34 changes: 30 additions & 4 deletions test/jdk/javax/swing/JPopupMenu/4966112/bug4966112.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,27 @@
* @author Alexander Zuev
* @run main bug4966112
*/
import javax.swing.*;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSpinner;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.PopupMenuListener;
import javax.swing.event.PopupMenuEvent;
import java.awt.*;
import java.awt.event.*;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Robot;
import java.awt.Point;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class bug4966112 {

Expand All @@ -48,6 +64,7 @@ public class bug4966112 {
private static volatile JFileChooser filec;
private static int buttonMask;
private static Robot robot;
private static boolean isAquaFileChooser;

public static void main(String[] args) throws Exception {
robot = new Robot();
Expand Down Expand Up @@ -99,6 +116,11 @@ public static void main(String[] args) throws Exception {
createAndShowFileChooser();
robot.waitForIdle();

if ((UIManager.getLookAndFeel().getID()).equals("Aqua")) {
isAquaFileChooser = true;
} else {
isAquaFileChooser = false;
}
clickMouse(filec);
robot.waitForIdle();

Expand Down Expand Up @@ -146,7 +168,11 @@ private static void setClickPoint(final JComponent c) throws Exception {
public void run() {
Point p = c.getLocationOnScreen();
Dimension size = c.getSize();
result[0] = new Point(p.x + size.width / 2, p.y + size.height / 2);
if (isAquaFileChooser) {
result[0] = new Point(p.x + size.width / 2, p.y + 5);
} else {
result[0] = new Point(p.x + size.width / 2, p.y + size.height / 2);
}
}
});

Expand Down

3 comments on commit 4d9f207

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 4d9f207 Sep 30, 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 4d9f207 Oct 28, 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 4d9f2073 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-4d9f2073
$ git fetch --no-tags https://git.openjdk.java.net/jdk 4d9f20734791b30000547e90171191ae690ed245
$ git cherry-pick --no-commit 4d9f20734791b30000547e90171191ae690ed245
$ # Resolve conflicts
$ git add files/with/resolved/conflicts
$ git commit -m 'Backport 4d9f20734791b30000547e90171191ae690ed245'

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

Please sign in to comment.