Add a wait after sending Gps Signal.

This commit is contained in:
youtaol
2012-08-03 15:22:35 +08:00
parent e94d62f6a9
commit 221155979e
2 changed files with 3 additions and 4 deletions
@@ -278,10 +278,7 @@ public class CreateAndSendTrackTest extends ActivityInstrumentationTestCase2<Tra
EndToEndTestUtils EndToEndTestUtils
.getButtonOnScreen(activityMyTracks.getString(R.string.generic_ok), true, true); .getButtonOnScreen(activityMyTracks.getString(R.string.generic_ok), true, true);
// Send Gps to give a distance more than one kilometer or one mile. // Send Gps to give a distance more than one kilometer or one mile.
EndToEndTestUtils.sendGps(20); EndToEndTestUtils.sendGps(20);
// Wait the GPS signal is obtained by MyTracks.
EndToEndTestUtils.SOLO.wait(EndToEndTestUtils.SHORT_WAIT_TIME);
assertTrue(EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_markers), assertTrue(EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_markers),
true)); true));
instrumentation.waitForIdleSync(); instrumentation.waitForIdleSync();
@@ -186,6 +186,8 @@ public class EndToEndTestUtils {
longitude += DELTA_LONGITUDE; longitude += DELTA_LONGITUDE;
latitude += DELTA_LADITUDE; latitude += DELTA_LADITUDE;
} }
// Wait the GPS signal can be obtained by MyTracks.
Thread.sleep(SHORT_WAIT_TIME);
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
System.exit(-1); System.exit(-1);
} catch (IOException e) { } catch (IOException e) {