author | avstepan |
Wed, 09 Jul 2014 12:56:03 +0400 | |
changeset 25759 | 625be49758c1 |
child 40128 | e635645d2a8a |
permissions | -rw-r--r-- |
25759
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
1 |
/* |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
2 |
* Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
4 |
* |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
8 |
* |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
13 |
* accompanied this code). |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
14 |
* |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
18 |
* |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
21 |
* questions. |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
22 |
*/ |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
23 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
24 |
import java.awt.*; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
25 |
import java.awt.event.KeyEvent; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
26 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
27 |
import static jdk.testlibrary.Asserts.*; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
28 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
29 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
30 |
/* |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
31 |
* @test |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
32 |
* @bug 8047367 |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
33 |
* @summary Check whether a Dialog set with null modality type |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
34 |
* behaves like a modeless dialog |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
35 |
* |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
36 |
* @library ../helpers ../../../../lib/testlibrary/ |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
37 |
* @build ExtendedRobot |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
38 |
* @build Flag |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
39 |
* @build TestDialog |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
40 |
* @build TestFrame |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
41 |
* @build TestWindow |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
42 |
* @run main NullModalityDialogTest |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
43 |
*/ |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
44 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
45 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
46 |
public class NullModalityDialogTest { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
47 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
48 |
class CustomDialog extends TestDialog { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
49 |
public CustomDialog(Frame f) { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
50 |
super(f); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
51 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
52 |
@Override |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
53 |
public void doOpenAction() { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
54 |
if (frame != null) { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
55 |
frame.setVisible(true); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
56 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
57 |
if (window != null) { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
58 |
window.setVisible(true); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
59 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
60 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
61 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
62 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
63 |
class CustomFrame extends TestFrame { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
64 |
@Override |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
65 |
public void doOpenAction() { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
66 |
if (dialog != null) { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
67 |
dialog.setVisible(true); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
68 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
69 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
70 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
71 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
72 |
private TestFrame parent; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
73 |
private TestDialog dialog; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
74 |
private TestFrame frame; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
75 |
private TestWindow window; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
76 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
77 |
private static final int delay = 1000; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
78 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
79 |
private final ExtendedRobot robot; |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
80 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
81 |
NullModalityDialogTest() throws Exception { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
82 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
83 |
robot = new ExtendedRobot(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
84 |
EventQueue.invokeLater(this::createGUI); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
85 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
86 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
87 |
private void createGUI() { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
88 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
89 |
parent = new CustomFrame(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
90 |
parent.setTitle("Parent"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
91 |
parent.setLocation(50, 50); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
92 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
93 |
dialog = new CustomDialog(parent); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
94 |
dialog.setTitle("Dialog"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
95 |
dialog.setModalityType((Dialog.ModalityType) null); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
96 |
dialog.setLocation(250, 50); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
97 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
98 |
frame = new TestFrame(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
99 |
frame.setTitle("Frame"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
100 |
frame.setLocation(50, 250); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
101 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
102 |
window = new TestWindow(frame); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
103 |
window.setLocation(250, 250); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
104 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
105 |
parent.setVisible(true); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
106 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
107 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
108 |
private void closeAll() { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
109 |
if (parent != null) { parent.dispose(); } |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
110 |
if (dialog != null) { dialog.dispose(); } |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
111 |
if (frame != null) { frame.dispose(); } |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
112 |
if (window != null) { window.dispose(); } |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
113 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
114 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
115 |
public void doTest() throws Exception { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
116 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
117 |
robot.waitForIdle(delay); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
118 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
119 |
parent.clickOpenButton(robot); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
120 |
robot.waitForIdle(delay); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
121 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
122 |
dialog.activated.waitForFlagTriggered(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
123 |
assertTrue(dialog.activated.flag(), "Dialog did not trigger " + |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
124 |
"Window Activated event when it became visible"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
125 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
126 |
dialog.closeGained.waitForFlagTriggered(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
127 |
assertTrue(dialog.closeGained.flag(), "the 1st button did not gain focus " + |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
128 |
"when the Dialog became visible"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
129 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
130 |
assertTrue(dialog.closeButton.hasFocus(), "the 1st button in the Dialog " + |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
131 |
"gained focus but lost it afterwards"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
132 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
133 |
dialog.openGained.reset(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
134 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
135 |
robot.type(KeyEvent.VK_TAB); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
136 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
137 |
dialog.openGained.waitForFlagTriggered(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
138 |
assertTrue(dialog.openGained.flag(), |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
139 |
"Tab navigation did not happen properly on Dialog. Open button " + |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
140 |
"did not gain focus on tab press when parent frame is visible"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
141 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
142 |
dialog.clickOpenButton(robot); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
143 |
robot.waitForIdle(delay); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
144 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
145 |
frame.activated.waitForFlagTriggered(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
146 |
assertTrue(frame.activated.flag(), "Frame did not trigger activated when " + |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
147 |
"made visible. Dialog and its parent frame are visible"); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
148 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
149 |
frame.checkUnblockedFrame(robot, "Frame is the parent of a visible Dialog."); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
150 |
window.checkUnblockedWindow(robot, "Frame and its child Dialog are visible."); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
151 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
152 |
robot.waitForIdle(delay); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
153 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
154 |
EventQueue.invokeAndWait(this::closeAll); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
155 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
156 |
|
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
157 |
public static void main(String[] args) throws Exception { |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
158 |
NullModalityDialogTest test = new NullModalityDialogTest(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
159 |
test.doTest(); |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
160 |
} |
625be49758c1
8047367: move awt automated tests from AWT_Modality to OpenJDK repository - part 2
avstepan
parents:
diff
changeset
|
161 |
} |