Skip to content

Commit f5beafa

Browse files
author
Alexander Zvegintsev
committedApr 16, 2022
8159599: [TEST_BUG] java/awt/Modal/ModalInternalFrameTest/ModalInternalFrameTest.java
Reviewed-by: serb, aivanov
1 parent 21de4e5 commit f5beafa

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed
 

‎test/jdk/ProblemList.txt

-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-a
133133
java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252 macosx-all
134134
java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java 8194753 linux-all,macosx-all
135135
java/awt/Focus/NoAutotransferToDisabledCompTest/NoAutotransferToDisabledCompTest.java 7152980 macosx-all
136-
java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java 8159599 macosx-all
137136
java/awt/Focus/TypeAhead/TestFocusFreeze.java 8198622,6447537 macosx-all,windows-all,linux-all
138137
java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java 7156130 linux-all
139138
java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java 8169096 macosx-all

‎test/jdk/java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java

+20-9
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,24 @@
2727
* @bug 6385277
2828
* @summary Tests that override redirect window gets activated on click.
2929
* @author anton.tarasov@sun.com: area=awt.focus
30-
* @library ../../regtesthelpers
31-
* @build Util
3230
* @run main SimpleWindowActivationTest
3331
*/
34-
import java.awt.*;
35-
import java.awt.event.*;
36-
import java.util.concurrent.Callable;
37-
import javax.swing.SwingUtilities;
38-
import test.java.awt.regtesthelpers.Util;
32+
33+
import java.awt.AWTEvent;
34+
import java.awt.Button;
35+
import java.awt.Component;
36+
import java.awt.Dimension;
37+
import java.awt.FlowLayout;
38+
import java.awt.Frame;
39+
import java.awt.Label;
40+
import java.awt.Point;
41+
import java.awt.Robot;
42+
import java.awt.Toolkit;
43+
import java.awt.Window;
44+
import java.awt.event.AWTEventListener;
45+
import java.awt.event.FocusEvent;
46+
import java.awt.event.InputEvent;
47+
import java.awt.event.WindowEvent;
3948

4049
public class SimpleWindowActivationTest {
4150

@@ -59,9 +68,11 @@ public void eventDispatched(AWTEvent e) {
5968

6069
createAndShowWindow();
6170
robot.waitForIdle();
71+
robot.delay(500);
6272

6373
createAndShowFrame();
6474
robot.waitForIdle();
75+
robot.delay(500);
6576

6677
// click on Frame
6778
clickOn(getClickPoint(frame));
@@ -130,8 +141,8 @@ static void clickOn(Point point) {
130141
robot.mouseMove(point.x, point.y);
131142
robot.waitForIdle();
132143

133-
robot.mousePress(InputEvent.BUTTON1_MASK);
134-
robot.mouseRelease(InputEvent.BUTTON1_MASK);
144+
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
145+
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
135146

136147
robot.waitForIdle();
137148
}

0 commit comments

Comments
 (0)
Please sign in to comment.