Use same thread to export track

This commit is contained in:
Jimmy Shih
2013-09-05 13:34:11 -07:00
parent 429ebdbf3a
commit 9ced32f2df
8 changed files with 53 additions and 122 deletions
@@ -65,11 +65,6 @@ public class GpxFileTrackImporterTest extends AbstractTestFileTrackImporter {
+ getNameAndDescription(TRACK_NAME_0, TRACK_DESCRIPTION_0) + "<trkseg>"
+ getTrackPoint(0, null) + getTrackPoint(1, null) + "</trkseg><trkseg>"
+ getTrackPoint(2, null) + getTrackPoint(3, null) + "</trkseg></trk></gpx>";
private static final String VALID_TWO_TRACKS_GPX = "<gpx><trk>"
+ getNameAndDescription(TRACK_NAME_0, TRACK_DESCRIPTION_0) + "<trkseg>"
+ getTrackPoint(0, TRACK_TIME_0) + "</trkseg></trk><trk>"
+ getNameAndDescription(TRACK_NAME_1, TRACK_DESCRIPTION_1) + "<trkseg>"
+ getTrackPoint(1, TRACK_TIME_1) + "</trkseg></trk></gpx>";
private static final String INVALID_XML_GPX = VALID_ONE_TRACK_ONE_SEGMENT_GPX.substring(
0, VALID_ONE_TRACK_ONE_SEGMENT_GPX.length() - 50);
@@ -7,9 +7,6 @@ import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
import com.google.android.apps.mytracks.content.MyTracksProviderUtils.Factory;
import com.google.android.apps.mytracks.content.Track;
import com.google.android.apps.mytracks.content.Waypoint;
import com.google.android.apps.mytracks.io.file.export.FileTrackExporter;
import com.google.android.apps.mytracks.io.file.export.TrackExporterListener;
import com.google.android.apps.mytracks.io.file.export.TrackWriter;
import com.google.android.apps.mytracks.services.TrackRecordingServiceTest.MockContext;
import com.google.android.apps.mytracks.testing.TestingProviderUtilsFactory;
@@ -101,9 +98,7 @@ public class FileTrackExporterTest extends AndroidTestCase {
trackWriter.writeFooter();
mocksControl.replay();
fileTrackExporter.writeTrack(outputStream);
assertTrue(fileTrackExporter.isSuccess());
assertTrue(fileTrackExporter.writeTrack(outputStream));
mocksControl.verify();
}
@@ -132,9 +127,8 @@ public class FileTrackExporterTest extends AndroidTestCase {
trackWriter.writeFooter();
mocksControl.replay();
fileTrackExporter.writeTrack(outputStream);
assertTrue(fileTrackExporter.isSuccess());
assertTrue(fileTrackExporter.writeTrack(outputStream));
mocksControl.verify();
}
@@ -196,9 +190,8 @@ public class FileTrackExporterTest extends AndroidTestCase {
trackWriter.writeFooter();
mocksControl.replay();
fileTrackExporter.writeTrack(outputStream);
assertTrue(fileTrackExporter.isSuccess());
assertTrue(fileTrackExporter.writeTrack(outputStream));
mocksControl.verify();
}