<AWT Dev> Patch for SelectionAutoscrollTest
Andrei.Dmitriev at Sun.COM
Wed Jul 1 01:18:28 PDT 2009
Hi Man Lung Wong,
generally speaking this approach is good enough but the better way is to
use SunToolkit.realSync() method which synchronously guarantees the
events from the queue are dispatched. You may notice that call from
within some other tests in the test/ folder. Just make a "grep" for it
to get an example.
But from the other hand, we have similar defect:
and the report mentions some issues with this approach mentioned above.
BTW, did you already created a defect in bugzilla? It would be just fine
to have a reference for every patch suggested and not let them sunk in
email boxes/mailing lists archives. :)
Man Wong wrote:
> 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
More information about the awt-dev