diff options
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); + } + } + +} |