--- old/./test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java 2010-01-25 13:24:34.000000000 +0100 +++ new/./test/java/awt/TextArea/UsingWithMouse/SelectionAutoscrollTest.java 2010-01-25 13:24:34.000000000 +0100 @@ -56,6 +56,7 @@ TextArea textArea; Robot robot; final int desiredSelectionEnd = ('z'-'a'+1)*2; // 52 + final int SCROLL_DELAY = 10; // 10ms public void start () { createObjects(); @@ -141,9 +142,17 @@ 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 ); + // it is needed to add some small delay on Gnome + waitUntilScrollIsPerformed(); + } + + void waitUntilScrollIsPerformed() { + try { Thread.sleep( SCROLL_DELAY ); } + catch( Exception e ) { throw new RuntimeException( e ); } } void checkResults() {