author | goetz |
Tue, 14 Jun 2016 10:44:59 +0200 | |
changeset 39056 | d99e63b6d962 |
parent 25559 | a101ec6ccfd3 |
permissions | -rw-r--r-- |
25559
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
1 |
/* |
39056
d99e63b6d962
8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents:
25559
diff
changeset
|
2 |
* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. |
25559
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
4 |
* |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
8 |
* |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
13 |
* accompanied this code). |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
14 |
* |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
18 |
* |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
21 |
* questions. |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
22 |
*/ |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
23 |
import java.awt.*; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
24 |
import java.awt.event.MouseAdapter; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
25 |
import java.awt.event.MouseEvent; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
26 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
27 |
/* |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
28 |
* @test |
39056
d99e63b6d962
8159690: [TESTBUG] Mark headful tests with @key headful.
goetz
parents:
25559
diff
changeset
|
29 |
* @key headful |
25559
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
30 |
* @summary Check if components present in a window set with opacity less than 1.0 |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
31 |
* triggers events correctly |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
32 |
* |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
33 |
* Test Description: Check if TRANSLUCENT Translucency type is supported on the |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
34 |
* current platform. Proceed if supported. Show a window which contains some |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
35 |
* components and set with opacity less than 1.0. Another Window having a |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
36 |
* canvas component drawn with an image can be used as the background for the |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
37 |
* test window. Click on the components present in the window and check if |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
38 |
* events trigger correctly. |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
39 |
* Expected Result: The components should trigger events correctly |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
40 |
* |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
41 |
* @author mrkam |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
42 |
* @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com) |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
43 |
* @library ../../../../lib/testlibrary |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
44 |
* @build Common ExtendedRobot |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
45 |
* @run main TranslucentWindowClick |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
46 |
*/ |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
47 |
public class TranslucentWindowClick extends Common { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
48 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
49 |
private Component south; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
50 |
private Component center; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
51 |
private Component north; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
52 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
53 |
volatile int clicked; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
54 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
55 |
public static void main(String[] args) throws Exception{ |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
56 |
if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.TRANSLUCENT)) |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
57 |
new TranslucentWindowClick(Window.class).doTest(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
58 |
} |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
59 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
60 |
public TranslucentWindowClick(Class windowClass) throws Exception { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
61 |
super(windowClass); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
62 |
} |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
63 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
64 |
@Override |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
65 |
public void initGUI() { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
66 |
if (windowClass.equals(Frame.class)) { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
67 |
window = new Frame(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
68 |
((Frame) window).setUndecorated(true); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
69 |
} else if (windowClass.equals(Dialog.class)) { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
70 |
window = new Dialog(background); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
71 |
((Dialog) window).setUndecorated(true); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
72 |
} else { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
73 |
window = new Window(background); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
74 |
} |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
75 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
76 |
window.setPreferredSize(new Dimension(200, 200)); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
77 |
window.setLocation(2 * dl, 2 * dl); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
78 |
window.setLayout(new BorderLayout()); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
79 |
window.setBackground(FG_COLOR); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
80 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
81 |
south = new Button("South"); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
82 |
south.addMouseListener(new MouseAdapter() { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
83 |
@Override |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
84 |
public void mouseClicked(MouseEvent e) { clicked |= 1 << 2; } |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
85 |
}); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
86 |
window.add(south, BorderLayout.SOUTH); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
87 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
88 |
center = new List(5); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
89 |
center.addMouseListener(new MouseAdapter() { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
90 |
@Override |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
91 |
public void mouseClicked(MouseEvent e) { clicked |= 1 << 1; } |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
92 |
}); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
93 |
window.add(center, BorderLayout.CENTER); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
94 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
95 |
north = new TextField("North"); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
96 |
north.addMouseListener(new MouseAdapter() { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
97 |
@Override |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
98 |
public void mouseClicked(MouseEvent e) { clicked |= 1 << 0; } |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
99 |
}); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
100 |
window.add(north, BorderLayout.NORTH); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
101 |
window.setOpacity(0.2f); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
102 |
window.pack(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
103 |
window.setVisible(true); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
104 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
105 |
System.out.println("Checking " + window.getClass().getName() + "..."); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
106 |
} |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
107 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
108 |
@Override |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
109 |
public void doTest() throws Exception { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
110 |
Point ls; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
111 |
robot.waitForIdle(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
112 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
113 |
ls = north.getLocationOnScreen(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
114 |
checkClick(ls.x + north.getWidth() / 3, ls.y + north.getHeight() / 2, 0); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
115 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
116 |
ls = center.getLocationOnScreen(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
117 |
checkClick(ls.x + center.getWidth() / 4, ls.y + center.getHeight() / 4, 1); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
118 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
119 |
ls = center.getLocationOnScreen(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
120 |
checkClick(ls.x + center.getWidth() * 3 / 4, ls.y + center.getHeight() * 3 / 4, 1); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
121 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
122 |
ls = south.getLocationOnScreen(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
123 |
checkClick(ls.x + south.getWidth() * 2 / 3, ls.y + south.getHeight() / 2, 2); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
124 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
125 |
EventQueue.invokeAndWait(() -> { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
126 |
background.dispose(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
127 |
window.dispose(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
128 |
}); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
129 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
130 |
robot.waitForIdle(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
131 |
} |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
132 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
133 |
@Override |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
134 |
public void applyShape() { } |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
135 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
136 |
void checkClick(int x, int y, int flag) throws Exception { |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
137 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
138 |
System.out.println("Trying to click point " + x + ", " + y + ", looking for " + flag + " flag to trigger."); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
139 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
140 |
clicked = 0; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
141 |
robot.mouseMove(x, y); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
142 |
robot.click(); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
143 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
144 |
for (int i = 0; i < 100; i++) |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
145 |
if ((clicked & (1 << flag)) == 0) |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
146 |
robot.delay(50); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
147 |
else |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
148 |
break; |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
149 |
|
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
150 |
if ((clicked & (1 << flag)) == 0) |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
151 |
throw new RuntimeException("FAIL: Flag " + flag + " is not triggered for point " + x + ", " + y + "!"); |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
152 |
} |
a101ec6ccfd3
8043131: Move ShapedAndTranslucentWindows and GC functional AWT tests to regression tree
yan
parents:
diff
changeset
|
153 |
} |