forked from upstream-mirrors/OpenTracks
Fix unit tests
- update string in CsvTrackWriter, CsvTrackWriterTest, and DescriptionGeneratorImplTest - with Solo, UploadResultActivity can run by itself, but cannot run as part of the unit test. Modify the test to not use Solo. - remove ANT+ tests in SensorManagerFactoryTest and replace them with bluetooth tests since most of the phones do not have ANT+. - remove TrackDetailActivityTest since we are no longer using it to start the app. Will replace this with end-to-end smoke tests.
This commit is contained in:
@@ -87,9 +87,9 @@ public class CsvTrackWriter implements TrackFormatWriter {
|
||||
|
||||
@Override
|
||||
public void writeHeader() {
|
||||
writeCommaSeparatedLine(context.getString(R.string.track_detail_track_name),
|
||||
context.getString(R.string.track_detail_activity_type_hint),
|
||||
context.getString(R.string.track_detail_track_description));
|
||||
writeCommaSeparatedLine(context.getString(R.string.track_edit_name),
|
||||
context.getString(R.string.track_edit_activity_type_hint),
|
||||
context.getString(R.string.track_edit_description));
|
||||
writeCommaSeparatedLine(track.getName(), track.getCategory(), track.getDescription());
|
||||
writeCommaSeparatedLine();
|
||||
}
|
||||
|
||||
+9
-1
@@ -21,6 +21,7 @@ import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesUtils;
|
||||
import com.google.android.apps.mytracks.io.maps.SendMapsUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
@@ -48,6 +49,7 @@ public class UploadResultActivity extends Activity {
|
||||
private SendRequest sendRequest;
|
||||
private Track track;
|
||||
private String shareUrl;
|
||||
private Dialog dialog;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -167,7 +169,8 @@ public class UploadResultActivity extends Activity {
|
||||
}
|
||||
});
|
||||
}
|
||||
return builder.create();
|
||||
dialog = builder.create();
|
||||
return dialog;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -186,4 +189,9 @@ public class UploadResultActivity extends Activity {
|
||||
shareUrlOnly ? url : getString(R.string.share_track_url_body_format, url));
|
||||
startActivity(Intent.createChooser(intent, getString(R.string.share_track_picker_title)));
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
Dialog getDialog() {
|
||||
return dialog;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user