Fix an error of test.

This commit is contained in:
youtaol
2012-12-20 19:10:28 +08:00
parent 1580389f8c
commit b464d78ae2
@@ -396,12 +396,17 @@ public class EndToEndTestUtils {
* @return return true if the track list is empty * @return return true if the track list is empty
*/ */
public static boolean isTrackListEmpty(boolean isClick) { public static boolean isTrackListEmpty(boolean isClick) {
instrumentation.waitForIdleSync();
int trackNumber = SOLO.getCurrentListViews().get(0).getCount(); int trackNumber = SOLO.getCurrentListViews().get(0).getCount();
if (trackNumber <= 0) { if (trackNumber <= 0) {
return true; return true;
} }
View oneTrack = SOLO.getCurrentListViews().get(0).getChildAt(0); View oneTrack = SOLO.getCurrentListViews().get(0).getChildAt(0);
trackName = (String) ((TextView) oneTrack.findViewById(R.id.list_item_name)).getText(); View aa = oneTrack.findViewById(R.id.list_item_name);
if (aa != null) {
trackName = (String) ((TextView) oneTrack.findViewById(R.id.list_item_name)).getText();
}
if (isClick) { if (isClick) {
SOLO.scrollUp(); SOLO.scrollUp();
SOLO.clickOnView(oneTrack); SOLO.clickOnView(oneTrack);