diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-03-14 16:10:49 -0400 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2016-03-15 14:07:24 -0400 |
commit | 9494fa72532f54e54a8b905acde7e188f4bb003b (patch) | |
tree | b17f549b3e05afc1740edbc205fcfa9f3f35e4ff | |
parent | d64b8ad25ca7c2297221337d4021924b5103cc77 (diff) | |
download | qtlocation-mapboxgl-9494fa72532f54e54a8b905acde7e188f4bb003b.tar.gz |
[android] #4308 - add some simple gesture tests
3 files changed, 64 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapboxMapUtils.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapboxMapUtils.java index 73cebf22a0..d41c692509 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapboxMapUtils.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/maps/MapboxMapUtils.java @@ -11,8 +11,18 @@ public class MapboxMapUtils { * @param mapView * @return */ - public static MapboxMap getMapboxMap(MapView mapView){ + public static MapboxMap getMapboxMap(MapView mapView) { return mapView.getMapboxMap(); } + /** + * Set the direction of the user + * + * @param mapView + * @param direction + */ + public static void setDirection(MapView mapView, double direction) { + mapView.setDirection(direction); + } + } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/robotium/SimpleRotateTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/robotium/SimpleRotateTest.java new file mode 100644 index 0000000000..f8075b7e58 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/robotium/SimpleRotateTest.java @@ -0,0 +1,27 @@ +package com.mapbox.mapboxsdk.testapp.robotium; + +import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; +import com.mapbox.mapboxsdk.geometry.LatLng; +import com.mapbox.mapboxsdk.maps.MapboxMapUtils; + +import org.junit.Test; + +public class SimpleRotateTest extends BaseMainActivityTest { + + @Override + public void setUp() throws Exception { + super.setUp(); + } + + @Test + public void testRotate() { + mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116), 15)); + double rotation = 0; + for (int i = 0; i < 180; i++) { + rotation += 1; + MapboxMapUtils.setDirection(mapView, rotation); + solo.sleep(100); + } + } + +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/robotium/SimpleZoomTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/robotium/SimpleZoomTest.java new file mode 100644 index 0000000000..03ac7ce25b --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/robotium/SimpleZoomTest.java @@ -0,0 +1,26 @@ +package com.mapbox.mapboxsdk.testapp.robotium; + +import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; +import com.mapbox.mapboxsdk.constants.MapboxConstants; +import com.mapbox.mapboxsdk.geometry.LatLng; + +import org.junit.Test; + +public class SimpleZoomTest extends BaseMainActivityTest { + + @Override + public void setUp() throws Exception { + super.setUp(); + } + + @Test + public void testZoomIn() { + float currentZoomlevel = MapboxConstants.MINIMUM_ZOOM; + while (currentZoomlevel < MapboxConstants.MAXIMUM_ZOOM - 5) { + mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(47.376271, 8.539116),currentZoomlevel)); + currentZoomlevel++; + solo.sleep(1400); + } + } + +} |