Hi

   I have encountered the jtreg failure of the selection autoscroll test 
(openjdk/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest). I 
found out the problem occurs because in the test, the mouse is not pressed for 
long enough outside the text box to allow the highlight to reach the bottom 
(even though the behaviour is still correct). Hence, all that was needed was to 
add a delay on the mouse press event after it had moved outside of the text 
box. The only concern I have is whether the duration for the delay I set is 
reasonable (I have it at 2s) or would a more generalized approach be more 
suitable (i.e. find a way to check if the highlighting is still moving on to 
the next character). Let me know what you think and thanks.

   By the way, my system is Fedora 10 32 bits running on gnome 2.24.3, icedtea6 
build with openjdk6.

Man Lung Wong
--- openjdk/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java.orig	2009-04-24 03:34:39.000000000 -0400
+++ openjdk/jdk/test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java	2009-06-29 17:11:27.000000000 -0400
@@ -37,7 +37,6 @@
  *   is hold pressed there.
  */
 
-
 import java.applet.Applet;
 import java.awt.Frame;
 import java.awt.Panel;
@@ -51,7 +50,6 @@
 import java.awt.Toolkit;
 import test.java.awt.regtesthelpers.Util;
 
-
 public class SelectionAutoscrollTest extends Applet {
     TextArea textArea;
     Robot robot;
@@ -95,6 +93,7 @@
     }
 
     void manipulateMouse() {
+
         moveMouseToCenterOfTextArea();
         Util.waitForIdle( robot );
 
@@ -128,6 +127,9 @@
             Util.waitForIdle( robot );
         }
 
+        //Added a delay such that mouse is pressed and held for longer to allow
+        //the autoscroll a chance to reach the end.
+        robot.delay(2000);
         robot.mouseRelease( MouseEvent.BUTTON1_MASK );
         Util.waitForIdle( robot );
     }

Reply via email to