silentsolo / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

Scroll may fail on PreferenceFragment. #614

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Basically in a PreferenceFragment all scrolling fails, i.e. scrollDown, 
scrollToBottom, or implicit scroll by searching.
This is because PreferenceFragment seems to have two ListViews (AbsListView).

This seems to depend on the order that views are returned so it is not easy to 
reproduce.
I don't know what changed, but we started seeng this jsut days ago, it worked 
before.

Debugging Robotium, I see that both views have the same position, the same 
height and the same drawing time.
So when Scroller.scroll calls viewFetcher.getFreshestView, it will return the 
first one.

But there is a difference between them, one has last postion -1 and count 0, 
the other does not.
If viewFetcher.getFreshestView returns the one with count == 0, all scroll 
fails.  If it returns the second one, scroll is fine.

A proposed change is that Scroller.scroll removes AbsListView:s with count == 0 
before calling viewFetcher.getFreshestView.  This makes everything work again.

What version of the product are you using? On what operating system?
5.0 and 5.1 and git latest on OSX 10.9

Original issue reported on code.google.com by jhdi...@gmail.com on 12 Jun 2014 at 9:35

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. This will be fixed in the next release. 

Original comment by renasr...@gmail.com on 13 Jun 2014 at 5:29