Merge heads

This commit is contained in:
youtaol
2012-07-12 11:15:34 +08:00
parent 9c807697de
commit be3422cf59
2 changed files with 55 additions and 8 deletions
@@ -264,6 +264,32 @@ public class CreateAndSendTrackTest extends ActivityInstrumentationTestCase2<Tra
EndToEndTestUtils.SOLO.goBack();
assertTrue(EndToEndTestUtils.SOLO.waitForText(EndToEndTestUtils.RELATIVE_STARTTIME_POSTFIX, 1, 5000));
}
/**
* Tests whether the split marker is created as setting.
*/
public void testSplitSetting() {
EndToEndTestUtils.startRecording();
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_split_frequency), true);
boolean isFoundKM = EndToEndTestUtils.SOLO.searchText(EndToEndTestUtils.ONE_KM);
if(isFoundKM) {
EndToEndTestUtils.SOLO.clickOnText(EndToEndTestUtils.ONE_KM);
} else {
EndToEndTestUtils.SOLO.clickOnText(EndToEndTestUtils.ONE_MILE);
}
EndToEndTestUtils.getButtonOnScreen(activityMyTracks.getString(R.string.generic_ok), true, true);
// Send Gps to give a distance more than one kilometer or one mile.
EndToEndTestUtils.sendGps(20);
EndToEndTestUtils.findMenuItem(activityMyTracks.getString(R.string.menu_markers), true);
instrumentation.waitForIdleSync();
assertTrue(EndToEndTestUtils.SOLO.getCurrentListViews().get(0).getCount() > 0);
EndToEndTestUtils.SOLO.goBack();
EndToEndTestUtils.stopRecording(true);
}
/**
* Creates a way point and a split maker during track recording.
@@ -73,9 +73,13 @@ public class EndToEndTestUtils {
// Following is some check strings in English and Chinese
private static final HashMap<String, String> RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL = new HashMap<String, String>();
private static final HashMap<String, String> VIEW_MODE_ENGLISH_MULTILINGUAL = new HashMap<String, String>();
private static final HashMap<String, String> VIEW_MODE_MULTILINGUAL = new HashMap<String, String>();
private static final HashMap<String, String> ONE_KM_MULTILINGUAL = new HashMap<String, String>();
private static final HashMap<String, String> ONE_MILE_MULTILINGUAL = new HashMap<String, String>();
public static String RELATIVE_STARTTIME_POSTFIX = "";
public static String VIEW_MODE = "";
public static String ONE_KM = "";
public static String ONE_MILE = "";
static {
RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL.put("es", "mins ago");
RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL.put("de", "Minuten");
@@ -83,11 +87,23 @@ public class EndToEndTestUtils {
RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL.put("ar", "دقيقة");
RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL.put("zh", "分钟前");
VIEW_MODE_ENGLISH_MULTILINGUAL.put("es", "mode");
VIEW_MODE_ENGLISH_MULTILINGUAL.put("de", "modus");
VIEW_MODE_ENGLISH_MULTILINGUAL.put("fr", "Mode");
VIEW_MODE_ENGLISH_MULTILINGUAL.put("ar", "وضع");
VIEW_MODE_ENGLISH_MULTILINGUAL.put("zh", "模式");
VIEW_MODE_MULTILINGUAL.put("es", "mode");
VIEW_MODE_MULTILINGUAL.put("de", "modus");
VIEW_MODE_MULTILINGUAL.put("fr", "Mode");
VIEW_MODE_MULTILINGUAL.put("ar", "وضع");
VIEW_MODE_MULTILINGUAL.put("zh", "模式");
ONE_KM_MULTILINGUAL.put("es", "1 km");
ONE_KM_MULTILINGUAL.put("de", "1 km");
ONE_KM_MULTILINGUAL.put("fr", "1 km");
ONE_KM_MULTILINGUAL.put("ar", "١ كم");
ONE_KM_MULTILINGUAL.put("zh", "1 公里");
ONE_MILE_MULTILINGUAL.put("es", "1 mi");
ONE_MILE_MULTILINGUAL.put("de", "1 mi");
ONE_MILE_MULTILINGUAL.put("fr", "1 mile");
ONE_MILE_MULTILINGUAL.put("ar", "١ ميل");
ONE_MILE_MULTILINGUAL.put("zh", "1 英里");
}
static Solo SOLO;
@@ -108,10 +124,14 @@ public class EndToEndTestUtils {
String deviceLanguage = instrumentation.getContext().getResources().getConfiguration().locale.getLanguage();
if (RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL.get(deviceLanguage) != null) {
RELATIVE_STARTTIME_POSTFIX = RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL.get(deviceLanguage);
VIEW_MODE = VIEW_MODE_ENGLISH_MULTILINGUAL.get(deviceLanguage);
VIEW_MODE = VIEW_MODE_MULTILINGUAL.get(deviceLanguage);
ONE_KM = ONE_KM_MULTILINGUAL.get(deviceLanguage);
ONE_MILE = ONE_MILE_MULTILINGUAL.get(deviceLanguage);
} else {
RELATIVE_STARTTIME_POSTFIX = RELATIVE_STARTTIME_POSTFIX_MULTILINGUAL.get("es");
VIEW_MODE = VIEW_MODE_ENGLISH_MULTILINGUAL.get("es");
VIEW_MODE = VIEW_MODE_MULTILINGUAL.get("es");
ONE_KM = ONE_KM_MULTILINGUAL.get("es");
ONE_MILE = ONE_MILE_MULTILINGUAL.get("es");
}
}
@@ -317,6 +337,7 @@ public class EndToEndTestUtils {
instrumentation.waitForIdleSync();
SOLO.clickOnText(activityMytracks.getString(R.string.menu_record_track));
}
instrumentation.waitForIdleSync();
}
/**