forked from upstream-mirrors/OpenTracks
merge heads
This commit is contained in:
@@ -1,14 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2012 Google Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.google.android.maps.mytracks.test"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
android:debuggable="true">
|
||||
<uses-sdk android:minSdkVersion="7" />
|
||||
<application android:icon="@android:drawable/sym_def_app_icon"
|
||||
android:label="My Tracks Tests">
|
||||
<uses-library android:name="android.test.runner" />
|
||||
</application>
|
||||
<instrumentation android:targetPackage="com.google.android.maps.mytracks"
|
||||
android:name="android.test.InstrumentationTestRunner" />
|
||||
android:debuggable="true"
|
||||
android:versionCode="1"
|
||||
android:versionName="1.0"
|
||||
package="com.google.android.maps.mytracks.test" >
|
||||
|
||||
<application
|
||||
android:icon="@android:drawable/sym_def_app_icon"
|
||||
android:label="My Tracks Tests" >
|
||||
<uses-library android:name="android.test.runner" />
|
||||
</application>
|
||||
|
||||
<instrumentation
|
||||
android:name="android.test.InstrumentationTestRunner"
|
||||
android:targetPackage="com.google.android.maps.mytracks" />
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="7"
|
||||
android:targetSdkVersion="15" />
|
||||
|
||||
</manifest>
|
||||
@@ -20,12 +20,10 @@ import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.apps.mytracks.content.Sensor.SensorDataSet;
|
||||
import com.google.android.apps.mytracks.util.UnitConversions;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.jayway.android.robotium.solo.Solo;
|
||||
|
||||
import android.app.Instrumentation;
|
||||
import android.location.Location;
|
||||
import android.test.ActivityInstrumentationTestCase2;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ZoomControls;
|
||||
|
||||
@@ -38,7 +36,6 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
||||
|
||||
private Instrumentation instrumentation;
|
||||
private ChartActivity chartActivity;
|
||||
private Solo solo;
|
||||
private View zoomIn;
|
||||
private View zoomOut;
|
||||
private int currentZoomLevel;
|
||||
@@ -104,27 +101,6 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
||||
assertEquals(false, zoomOut.isEnabled());
|
||||
}
|
||||
|
||||
/**
|
||||
* There are two parts in this test. Tests
|
||||
* {@link ChartActivity#onCreateDialog(int)} which includes the logic to create
|
||||
* {@link ChartSettingsDialog}.
|
||||
*/
|
||||
public void testCreateSettingDialog() {
|
||||
solo = new Solo(instrumentation, chartActivity);
|
||||
// Part1, tests {@link ChartActivity#onCreateOptionsMenu()}. Check if
|
||||
// optional menu is created.
|
||||
assertNull(chartActivity.getChartSettingsMenuItem());
|
||||
sendKeys(KeyEvent.KEYCODE_MENU);
|
||||
assertNotNull(chartActivity.getChartSettingsMenuItem());
|
||||
|
||||
// Part2, tests {@link ChartActivity#onOptionsItemSelected()}. Clicks on the
|
||||
// "Chart settings", and then verify that the dialog contains the
|
||||
// "By distance" text.
|
||||
solo.clickOnText(chartActivity.getString(R.string.menu_chart_view_chart_settings));
|
||||
instrumentation.waitForIdleSync();
|
||||
assertTrue(solo.searchText(chartActivity.getString(R.string.chart_settings_by_distance)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the logic to get the incorrect values of sensor in {@link
|
||||
* ChartActivity#fillDataPoint(Location, double[])}.
|
||||
|
||||
Reference in New Issue
Block a user