diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/RuntimeStyleTests.java | 25 |
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() { |