Cherry picks to release branch (#9230)

* [ios][macos] test remove source in use

* [android] test remove source in use

* [core] check source usage before remove

* [core] ensure layer::accept works with non-void return values on gcc

* [android] - remove upgrade runtime exceptions (#9191)
This commit is contained in:
Tobrun
2017-06-09 12:05:54 +02:00
committed by GitHub
parent fa972fad60
commit 6ec5e4f8cd
6 changed files with 98 additions and 16 deletions

View File

@@ -12,6 +12,7 @@ import com.mapbox.mapboxsdk.style.layers.CannotAddLayerException;
import com.mapbox.mapboxsdk.style.layers.CircleLayer;
import com.mapbox.mapboxsdk.style.layers.FillLayer;
import com.mapbox.mapboxsdk.style.layers.Layer;
import com.mapbox.mapboxsdk.style.layers.LineLayer;
import com.mapbox.mapboxsdk.style.layers.Property;
import com.mapbox.mapboxsdk.style.layers.PropertyFactory;
import com.mapbox.mapboxsdk.style.sources.CannotAddSourceException;
@@ -223,6 +224,23 @@ public class RuntimeStyleTests extends BaseActivityTest {
assertEquals("http://mapbox.com/my-file.json", source.getUrl());
}
@Test
public void testRemoveSourceInUse() {
validateTestSetup();
onView(withId(R.id.mapView)).perform(new BaseViewAction() {
@Override
public void perform(UiController uiController, View view) {
mapboxMap.addSource(new VectorSource("my-source", "mapbox://mapbox.mapbox-terrain-v2"));
mapboxMap.addLayer(new LineLayer("my-layer", "my-source"));
mapboxMap.removeSource("my-source");
assertNotNull(mapboxMap.getSource("my-source"));
}
});
}
/**
* https://github.com/mapbox/mapbox-gl-native/issues/7973
*/