summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-02-24 18:19:04 +0200
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-02-28 09:33:04 -0800
commita9d2929819a5b4268a83e8ccd90eeb0b1f1e2f72 (patch)
treecc0a0376967e7e7d4f8131c428c86a0d7392f41d /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java
parentdc21396d71ea28b736ee6fb3dcd476fed80fbd5d (diff)
downloadqtlocation-mapboxgl-a9d2929819a5b4268a83e8ccd90eeb0b1f1e2f72.tar.gz
[android] remove layer at index
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java
index 2014208fcf..76a9de730b 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java
@@ -35,6 +35,8 @@ import org.junit.runner.RunWith;
import java.util.List;
+import timber.log.Timber;
+
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
@@ -123,6 +125,29 @@ public class RuntimeStyleTests {
}
@Test
+ public void testRemoveLayerAt() {
+ ViewUtils.checkViewIsDisplayed(R.id.mapView);
+ onView(withId(R.id.mapView)).perform(new BaseViewAction() {
+
+ @Override
+ public void perform(UiController uiController, View view) {
+ MapboxMap mapboxMap = rule.getActivity().getMapboxMap();
+
+ // Remove by index
+ Layer firstLayer = mapboxMap.getLayers().get(0);
+ Layer removed = mapboxMap.removeLayerAt(0);
+ assertNotNull(removed);
+ assertNotNull(removed.getId());
+ assertEquals(firstLayer.getId(), removed.getId());
+
+ // Test remove by index bounds checks
+ Timber.i("Remove layer at index > size");
+ assertNull(mapboxMap.removeLayerAt(Integer.MAX_VALUE));
+ }
+ });
+ }
+
+ @Test
public void testListSources() {
ViewUtils.checkViewIsDisplayed(R.id.mapView);
onView(withId(R.id.mapView)).perform(new BaseViewAction() {