author | hseigel |
Wed, 01 Mar 2017 08:00:02 -0500 | |
changeset 46194 | 5596e6f63072 |
parent 40128 | e635645d2a8a |
permissions | -rw-r--r-- |
20162
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
1 |
/* |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
2 |
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
4 |
* |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
8 |
* |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
13 |
* accompanied this code). |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
14 |
* |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
18 |
* |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
21 |
* questions. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
22 |
*/ |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
23 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
24 |
import java.awt.*; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
25 |
import java.awt.event.*; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
26 |
import javax.swing.*; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
27 |
import javax.swing.event.*; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
28 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
29 |
/** |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
30 |
* @test @bug 4245587 4474813 4425878 4767478 8015599 |
40128
e635645d2a8a
8160974: [TESTBUG] Mark more headful tests with @key headful.
goetz
parents:
28071
diff
changeset
|
31 |
* @key headful |
20162
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
32 |
* @author Mark Davidson |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
33 |
* @summary Tests the location of the heavy weight popup portion of JComboBox, |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
34 |
* JMenu and JPopupMenu. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
35 |
* @library ../regtesthelpers |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
36 |
* @build Util |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
37 |
* @run main TaskbarPositionTest |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
38 |
*/ |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
39 |
public class TaskbarPositionTest extends JFrame implements ActionListener { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
40 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
41 |
private boolean done; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
42 |
private Throwable error; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
43 |
private static TaskbarPositionTest test; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
44 |
private static JPopupMenu popupMenu; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
45 |
private static JPanel panel; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
46 |
private static JComboBox<String> combo1; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
47 |
private static JComboBox<String> combo2; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
48 |
private static JMenuBar menubar; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
49 |
private static JMenu menu1; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
50 |
private static JMenu menu2; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
51 |
private static Rectangle fullScreenBounds; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
52 |
// The usable desktop space: screen size - screen insets. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
53 |
private static Rectangle screenBounds; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
54 |
private static String[] numData = { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
55 |
"One", "Two", "Three", "Four", "Five", "Six", "Seven" |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
56 |
}; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
57 |
private static String[] dayData = { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
58 |
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
59 |
}; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
60 |
private static char[] mnDayData = { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
61 |
'M', 'T', 'W', 'R', 'F', 'S', 'U' |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
62 |
}; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
63 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
64 |
public TaskbarPositionTest() { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
65 |
super("Use CTRL-down to show a JPopupMenu"); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
66 |
setContentPane(panel = createContentPane()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
67 |
setJMenuBar(createMenuBar("1 - First Menu", true)); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
68 |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
69 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
70 |
// CTRL-down will show the popup. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
71 |
panel.getInputMap().put(KeyStroke.getKeyStroke( |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
72 |
KeyEvent.VK_DOWN, InputEvent.CTRL_MASK), "OPEN_POPUP"); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
73 |
panel.getActionMap().put("OPEN_POPUP", new PopupHandler()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
74 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
75 |
pack(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
76 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
77 |
Toolkit toolkit = Toolkit.getDefaultToolkit(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
78 |
fullScreenBounds = new Rectangle(new Point(), toolkit.getScreenSize()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
79 |
screenBounds = new Rectangle(new Point(), toolkit.getScreenSize()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
80 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
81 |
// Place the frame near the bottom. This is a pretty wild guess. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
82 |
this.setLocation(0, (int) screenBounds.getHeight() - 2 * this.getHeight()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
83 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
84 |
// Reduce the screen bounds by the insets. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
85 |
GraphicsConfiguration gc = this.getGraphicsConfiguration(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
86 |
if (gc != null) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
87 |
Insets screenInsets = toolkit.getScreenInsets(gc); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
88 |
screenBounds = gc.getBounds(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
89 |
screenBounds.width -= (screenInsets.left + screenInsets.right); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
90 |
screenBounds.height -= (screenInsets.top + screenInsets.bottom); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
91 |
screenBounds.x += screenInsets.left; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
92 |
screenBounds.y += screenInsets.top; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
93 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
94 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
95 |
setVisible(true); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
96 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
97 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
98 |
public static class ComboPopupCheckListener implements PopupMenuListener { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
99 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
100 |
public void popupMenuCanceled(PopupMenuEvent ev) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
101 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
102 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
103 |
public void popupMenuWillBecomeVisible(PopupMenuEvent ev) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
104 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
105 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
106 |
public void popupMenuWillBecomeInvisible(PopupMenuEvent ev) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
107 |
Point cpos = combo1.getLocation(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
108 |
SwingUtilities.convertPointToScreen(cpos, panel); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
109 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
110 |
JPopupMenu pm = (JPopupMenu) combo1.getUI().getAccessibleChild(combo1, 0); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
111 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
112 |
if (pm != null) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
113 |
Point p = pm.getLocation(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
114 |
SwingUtilities.convertPointToScreen(p, pm); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
115 |
if (p.y < cpos.y) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
116 |
throw new RuntimeException("ComboBox popup is wrongly aligned"); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
117 |
} // check that popup was opened down |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
118 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
119 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
120 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
121 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
122 |
private class PopupHandler extends AbstractAction { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
123 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
124 |
public void actionPerformed(ActionEvent e) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
125 |
if (!popupMenu.isVisible()) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
126 |
popupMenu.show((Component) e.getSource(), 40, 40); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
127 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
128 |
isPopupOnScreen(popupMenu, fullScreenBounds); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
129 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
130 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
131 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
132 |
class PopupListener extends MouseAdapter { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
133 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
134 |
private JPopupMenu popup; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
135 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
136 |
public PopupListener(JPopupMenu popup) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
137 |
this.popup = popup; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
138 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
139 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
140 |
public void mousePressed(MouseEvent e) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
141 |
maybeShowPopup(e); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
142 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
143 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
144 |
public void mouseReleased(MouseEvent e) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
145 |
maybeShowPopup(e); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
146 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
147 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
148 |
private void maybeShowPopup(MouseEvent e) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
149 |
if (e.isPopupTrigger()) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
150 |
popup.show(e.getComponent(), e.getX(), e.getY()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
151 |
isPopupOnScreen(popup, fullScreenBounds); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
152 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
153 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
154 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
155 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
156 |
/** |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
157 |
* Tests if the popup is on the screen. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
158 |
*/ |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
159 |
public static void isPopupOnScreen(JPopupMenu popup, Rectangle checkBounds) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
160 |
Dimension dim = popup.getSize(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
161 |
Point pt = new Point(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
162 |
SwingUtilities.convertPointToScreen(pt, popup); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
163 |
Rectangle bounds = new Rectangle(pt, dim); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
164 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
165 |
if (!SwingUtilities.isRectangleContainingRectangle(checkBounds, bounds)) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
166 |
throw new RuntimeException("We do not match! " + checkBounds + " / " + bounds); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
167 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
168 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
169 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
170 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
171 |
private JPanel createContentPane() { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
172 |
JPanel panel = new JPanel(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
173 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
174 |
combo1 = new JComboBox<>(numData); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
175 |
panel.add(combo1); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
176 |
combo2 = new JComboBox<>(dayData); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
177 |
combo2.setEditable(true); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
178 |
panel.add(combo2); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
179 |
panel.setSize(300, 200); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
180 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
181 |
popupMenu = new JPopupMenu(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
182 |
JMenuItem item; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
183 |
for (int i = 0; i < dayData.length; i++) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
184 |
item = popupMenu.add(new JMenuItem(dayData[i], mnDayData[i])); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
185 |
item.addActionListener(this); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
186 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
187 |
panel.addMouseListener(new PopupListener(popupMenu)); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
188 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
189 |
JTextField field = new JTextField("CTRL+down for Popup"); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
190 |
// CTRL-down will show the popup. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
191 |
field.getInputMap().put(KeyStroke.getKeyStroke( |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
192 |
KeyEvent.VK_DOWN, InputEvent.CTRL_MASK), "OPEN_POPUP"); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
193 |
field.getActionMap().put("OPEN_POPUP", new PopupHandler()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
194 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
195 |
panel.add(field); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
196 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
197 |
return panel; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
198 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
199 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
200 |
/** |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
201 |
* @param str name of Menu |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
202 |
* @param bFlag set mnemonics on menu items |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
203 |
*/ |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
204 |
private JMenuBar createMenuBar(String str, boolean bFlag) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
205 |
menubar = new JMenuBar(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
206 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
207 |
menu1 = new JMenu(str); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
208 |
menu1.setMnemonic(str.charAt(0)); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
209 |
menu1.addActionListener(this); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
210 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
211 |
menubar.add(menu1); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
212 |
for (int i = 0; i < 8; i++) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
213 |
JMenuItem menuitem = new JMenuItem("1 JMenuItem" + i); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
214 |
menuitem.addActionListener(this); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
215 |
if (bFlag) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
216 |
menuitem.setMnemonic('0' + i); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
217 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
218 |
menu1.add(menuitem); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
219 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
220 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
221 |
// second menu |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
222 |
menu2 = new JMenu("2 - Second Menu"); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
223 |
menu2.addActionListener(this); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
224 |
menu2.setMnemonic('2'); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
225 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
226 |
menubar.add(menu2); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
227 |
for (int i = 0; i < 5; i++) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
228 |
JMenuItem menuitem = new JMenuItem("2 JMenuItem" + i); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
229 |
menuitem.addActionListener(this); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
230 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
231 |
if (bFlag) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
232 |
menuitem.setMnemonic('0' + i); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
233 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
234 |
menu2.add(menuitem); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
235 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
236 |
JMenu submenu = new JMenu("Sub Menu"); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
237 |
submenu.setMnemonic('S'); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
238 |
submenu.addActionListener(this); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
239 |
for (int i = 0; i < 5; i++) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
240 |
JMenuItem menuitem = new JMenuItem("S JMenuItem" + i); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
241 |
menuitem.addActionListener(this); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
242 |
if (bFlag) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
243 |
menuitem.setMnemonic('0' + i); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
244 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
245 |
submenu.add(menuitem); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
246 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
247 |
menu2.add(new JSeparator()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
248 |
menu2.add(submenu); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
249 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
250 |
return menubar; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
251 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
252 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
253 |
public void actionPerformed(ActionEvent evt) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
254 |
Object obj = evt.getSource(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
255 |
if (obj instanceof JMenuItem) { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
256 |
// put the focus on the noneditable combo. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
257 |
combo1.requestFocus(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
258 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
259 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
260 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
261 |
public static void main(String[] args) throws Throwable { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
262 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
263 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
264 |
SwingUtilities.invokeAndWait(new Runnable() { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
265 |
public void run() { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
266 |
test = new TaskbarPositionTest(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
267 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
268 |
}); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
269 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
270 |
// Use Robot to automate the test |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
271 |
Robot robot; |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
272 |
robot = new Robot(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
273 |
robot.setAutoDelay(125); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
274 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
275 |
// 1 - menu |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
276 |
Util.hitMnemonics(robot, KeyEvent.VK_1); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
277 |
|
28071
3acb75b8df45
8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents:
20162
diff
changeset
|
278 |
robot.waitForIdle(); |
20162
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
279 |
isPopupOnScreen(menu1.getPopupMenu(), screenBounds); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
280 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
281 |
// 2 menu with sub menu |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
282 |
robot.keyPress(KeyEvent.VK_RIGHT); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
283 |
robot.keyRelease(KeyEvent.VK_RIGHT); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
284 |
Util.hitMnemonics(robot, KeyEvent.VK_S); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
285 |
|
28071
3acb75b8df45
8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents:
20162
diff
changeset
|
286 |
robot.waitForIdle(); |
20162
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
287 |
isPopupOnScreen(menu2.getPopupMenu(), screenBounds); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
288 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
289 |
robot.keyPress(KeyEvent.VK_ENTER); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
290 |
robot.keyRelease(KeyEvent.VK_ENTER); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
291 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
292 |
// Focus should go to non editable combo box |
28071
3acb75b8df45
8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents:
20162
diff
changeset
|
293 |
robot.waitForIdle(); |
20162
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
294 |
Thread.sleep(500); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
295 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
296 |
robot.keyPress(KeyEvent.VK_DOWN); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
297 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
298 |
// How do we check combo boxes? |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
299 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
300 |
// Editable combo box |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
301 |
robot.keyPress(KeyEvent.VK_TAB); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
302 |
robot.keyRelease(KeyEvent.VK_TAB); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
303 |
robot.keyPress(KeyEvent.VK_DOWN); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
304 |
robot.keyRelease(KeyEvent.VK_DOWN); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
305 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
306 |
// combo1.getUI(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
307 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
308 |
// Popup from Text field |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
309 |
robot.keyPress(KeyEvent.VK_TAB); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
310 |
robot.keyRelease(KeyEvent.VK_TAB); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
311 |
robot.keyPress(KeyEvent.VK_CONTROL); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
312 |
robot.keyPress(KeyEvent.VK_DOWN); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
313 |
robot.keyRelease(KeyEvent.VK_DOWN); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
314 |
robot.keyRelease(KeyEvent.VK_CONTROL); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
315 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
316 |
// Popup from a mouse click. |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
317 |
Point pt = new Point(2, 2); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
318 |
SwingUtilities.convertPointToScreen(pt, panel); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
319 |
robot.mouseMove((int) pt.getX(), (int) pt.getY()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
320 |
robot.mousePress(InputEvent.BUTTON3_MASK); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
321 |
robot.mouseRelease(InputEvent.BUTTON3_MASK); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
322 |
|
28071
3acb75b8df45
8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents:
20162
diff
changeset
|
323 |
robot.waitForIdle(); |
20162
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
324 |
SwingUtilities.invokeAndWait(new Runnable() { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
325 |
public void run() { |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
326 |
test.setLocation(-30, 100); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
327 |
combo1.addPopupMenuListener(new ComboPopupCheckListener()); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
328 |
combo1.requestFocus(); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
329 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
330 |
}); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
331 |
|
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
332 |
robot.keyPress(KeyEvent.VK_DOWN); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
333 |
robot.keyRelease(KeyEvent.VK_DOWN); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
334 |
robot.keyPress(KeyEvent.VK_ESCAPE); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
335 |
robot.keyRelease(KeyEvent.VK_ESCAPE); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
336 |
|
28071
3acb75b8df45
8063107: Change open swing regression tests to avoid sun.awt.SunToolkit.realSync, part 2
yan
parents:
20162
diff
changeset
|
337 |
robot.waitForIdle(); |
20162
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
338 |
Thread.sleep(500); |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
339 |
} |
85aeb6f617a4
8015599: [TEST_BUG] [macosx] Test closed/javax/swing/Popup/TaskbarPositionTest.java fails since JDK 8 b75 on MacOSX
kshefov
parents:
diff
changeset
|
340 |
} |