/hg/icedtea6: Patch for test awt/TextArea/UsingWithMouse.java
ptisnovs at icedtea.classpath.org
ptisnovs at icedtea.classpath.org
Thu Jan 28 02:29:39 PST 2010
changeset 102fc7d29141 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=102fc7d29141
author: ptisnovs
date: Thu Jan 28 11:30:12 2010 +0100
Patch for test awt/TextArea/UsingWithMouse.java
diffstat:
1 file changed, 45 insertions(+)
patches/icedtea-6920143-using-with-mouse.patch | 45 ++++++++++++++++++++++++
diffs (49 lines):
diff -r a1e161b0156e -r 102fc7d29141 patches/icedtea-6920143-using-with-mouse.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/icedtea-6920143-using-with-mouse.patch Thu Jan 28 11:30:12 2010 +0100
@@ -0,0 +1,45 @@
+6920143: test/java/awt/TestArea/UsingWithMouse.java needs realSync()
+Summary: Added small delay to make sure that TextArea animation have finished
+Reviewed-by: anthony
+
+--- openjdk.orig/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java 2010-01-27 14:45:28.000000000 +0100
++++ openjdk/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java 2010-01-27 14:45:27.000000000 +0100
+@@ -56,6 +56,7 @@
+ TextArea textArea;
+ Robot robot;
+ final int desiredSelectionEnd = ('z'-'a'+1)*2; // 52
++ final static int SCROLL_DELAY = 100; // ms
+
+ public void start () {
+ createObjects();
+@@ -126,6 +127,8 @@
+
+ moveMouseBelowTextArea( tremble%2!=0 );
+ Util.waitForIdle( robot );
++ // it is needed to add some small delay on Gnome
++ waitUntilScrollIsPerformed(robot);
+ }
+
+ robot.mouseRelease( MouseEvent.BUTTON1_MASK );
+@@ -141,9 +144,19 @@
+ void moveMouseBelowTextArea( boolean shift ) {
+ Dimension d = textArea.getSize();
+ Point l = textArea.getLocationOnScreen();
++ int x = (int)(l.x+d.width*.5);
+ int y = (int)(l.y+d.height*1.5);
+ if( shift ) y+=15;
+- robot.mouseMove( (int)(l.x+d.width*.5), y );
++ robot.mouseMove( x, y );
++ }
++
++ void waitUntilScrollIsPerformed(Robot robot) {
++ try {
++ Thread.sleep( SCROLL_DELAY );
++ }
++ catch( Exception e ) {
++ throw new RuntimeException( e );
++ }
+ }
+
+ void checkResults() {
+
More information about the distro-pkg-dev
mailing list