Merge heads

This commit is contained in:
youtaol
2012-08-31 09:57:35 +08:00
30 changed files with 430 additions and 313 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ limitations under the License.
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />
android:targetSdkVersion="16" />
<application
android:label="My Tracks Tests" >
+1 -1
View File
@@ -10,4 +10,4 @@
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=Google Inc.:Google APIs:15
target=Google Inc.:Google APIs:16
@@ -161,7 +161,7 @@ public class CreateAndSendTrackTest extends ActivityInstrumentationTestCase2<Tra
if (EndToEndTestUtils.hasActionBar) {
// Check the title is Recording.
assertTrue(EndToEndTestUtils.SOLO.searchText(activityMyTracks
.getString(R.string.icon_recording)));
.getString(R.string.generic_recording)));
}
createWaypoint();
@@ -237,6 +237,34 @@ public class TrackWriterTest extends AndroidTestCase {
mocksControl.verify();
}
/**
* Tests when a track only contains invalid locations. Make sure an empty
* track is written.
*/
public void testWriteDocument_oneInvalidLocation() throws Exception {
writer = new TrackWriterImpl(getContext(), providerUtils, track, formatWriter);
Location[] locs = { new Location("fake0") };
fillLocations(locs);
// Make location invalid
locs[0].setLatitude(100);
assertEquals(locs.length, providerUtils.bulkInsertTrackPoint(locs, locs.length, TRACK_ID));
formatWriter.writeHeader();
formatWriter.writeBeginTrack(null);
formatWriter.writeEndTrack(null);
formatWriter.writeFooter();
formatWriter.close();
mocksControl.replay();
writer.writeDocument();
assertTrue(writer.wasSuccess());
mocksControl.verify();
}
public void testWriteDocument() throws Exception {
writer = new TrackWriterImpl(getContext(), providerUtils, track, formatWriter);