author | serb |
Fri, 11 Sep 2015 15:03:53 +0300 | |
changeset 32677 | 171c6332a2cd |
child 39056 | d99e63b6d962 |
permissions | -rw-r--r-- |
32677
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
1 |
/* |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
4 |
* |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
8 |
* |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
13 |
* accompanied this code). |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
14 |
* |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
18 |
* |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
21 |
* questions. |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
22 |
*/ |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
23 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
24 |
/* |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
25 |
* @test |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
26 |
* @bug 6430601 |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
27 |
* @summary Verifies that copyArea() works properly when the |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
28 |
* destination parameters are outside the destination bounds. |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
29 |
* @run main/othervm CopyAreaOOB |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
30 |
* @run main/othervm -Dsun.java2d.opengl=True CopyAreaOOB |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
31 |
* @author campbelc |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
32 |
*/ |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
33 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
34 |
import java.awt.*; |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
35 |
import java.awt.image.*; |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
36 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
37 |
public class CopyAreaOOB extends Canvas { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
38 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
39 |
private static boolean done; |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
40 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
41 |
public void paint(Graphics g) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
42 |
synchronized (this) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
43 |
if (done) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
44 |
return; |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
45 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
46 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
47 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
48 |
int w = getWidth(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
49 |
int h = getHeight(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
50 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
51 |
Graphics2D g2d = (Graphics2D)g; |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
52 |
g2d.setColor(Color.black); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
53 |
g2d.fillRect(0, 0, w, h); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
54 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
55 |
g2d.setColor(Color.green); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
56 |
g2d.fillRect(0, 0, w, 10); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
57 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
58 |
g2d.setColor(Color.red); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
59 |
g2d.fillRect(0, 10, 50, h-10); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
60 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
61 |
// copy the region such that part of it goes below the bottom of the |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
62 |
// destination surface |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
63 |
g2d.copyArea(0, 10, 50, h-10, 60, 10); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
64 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
65 |
Toolkit.getDefaultToolkit().sync(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
66 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
67 |
synchronized (this) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
68 |
done = true; |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
69 |
notifyAll(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
70 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
71 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
72 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
73 |
public Dimension getPreferredSize() { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
74 |
return new Dimension(400, 400); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
75 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
76 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
77 |
private static void testRegion(BufferedImage bi, String name, |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
78 |
int x1, int y1, int x2, int y2, |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
79 |
int expected) |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
80 |
{ |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
81 |
for (int y = y1; y < y2; y++) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
82 |
for (int x = x1; x < x2; x++) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
83 |
int actual = bi.getRGB(x, y); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
84 |
if (actual != expected) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
85 |
throw new RuntimeException("Test failed for " + name + |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
86 |
" region at x="+x+" y="+y+ |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
87 |
" (expected="+ |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
88 |
Integer.toHexString(expected) + |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
89 |
" actual="+ |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
90 |
Integer.toHexString(actual) + |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
91 |
")"); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
92 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
93 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
94 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
95 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
96 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
97 |
public static void main(String[] args) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
98 |
boolean show = (args.length == 1) && ("-show".equals(args[0])); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
99 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
100 |
CopyAreaOOB test = new CopyAreaOOB(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
101 |
Frame frame = new Frame(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
102 |
frame.setUndecorated(true); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
103 |
frame.add(test); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
104 |
frame.pack(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
105 |
frame.setLocationRelativeTo(null); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
106 |
frame.setVisible(true); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
107 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
108 |
// Wait until the component's been painted |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
109 |
synchronized (test) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
110 |
while (!done) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
111 |
try { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
112 |
test.wait(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
113 |
} catch (InterruptedException e) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
114 |
throw new RuntimeException("Failed: Interrupted"); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
115 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
116 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
117 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
118 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
119 |
try { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
120 |
Thread.sleep(2000); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
121 |
} catch (InterruptedException ex) {} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
122 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
123 |
// Grab the screen region |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
124 |
BufferedImage capture = null; |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
125 |
try { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
126 |
Robot robot = new Robot(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
127 |
Point pt1 = test.getLocationOnScreen(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
128 |
Rectangle rect = new Rectangle(pt1.x, pt1.y, 400, 400); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
129 |
capture = robot.createScreenCapture(rect); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
130 |
} catch (Exception e) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
131 |
throw new RuntimeException("Problems creating Robot"); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
132 |
} finally { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
133 |
if (!show) { |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
134 |
frame.dispose(); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
135 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
136 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
137 |
|
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
138 |
// Test pixels |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
139 |
testRegion(capture, "green", 0, 0, 400, 10, 0xff00ff00); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
140 |
testRegion(capture, "original red", 0, 10, 50, 400, 0xffff0000); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
141 |
testRegion(capture, "background", 50, 10, 60, 400, 0xff000000); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
142 |
testRegion(capture, "in-between", 60, 10, 110, 20, 0xff000000); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
143 |
testRegion(capture, "copied red", 60, 20, 110, 400, 0xffff0000); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
144 |
testRegion(capture, "background", 110, 10, 400, 400, 0xff000000); |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
145 |
} |
171c6332a2cd
7131835: [TEST_BUG] Test does not consider that the rounded edges of the window in Mac OS 10.7
serb
parents:
diff
changeset
|
146 |
} |