summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
diff options
context:
space:
mode:
authorŁukasz Paczos <lukas.paczos@gmail.com>2019-03-08 14:06:36 +0100
committerŁukasz Paczos <lukas.paczos@gmail.com>2019-03-08 18:04:17 +0100
commit5bd975306c4adeef5aafbea6eb7e038894cfca08 (patch)
tree2b9e95074b15574a1582a395e786b7ac310d6a17 /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
parent5e2b6bf636472a4464e6ab3ae0d9d01c68de041b (diff)
downloadqtlocation-mapboxgl-5bd975306c4adeef5aafbea6eb7e038894cfca08.tar.gz
[android] throw an exception if the component is accessed before the activationupstream/lp-location-component-initializaiton-exception
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
index 01d8761cf3..dde03d8a14 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
@@ -594,15 +594,20 @@ class LocationComponentTest : EspressoTest() {
val componentAction = object : LocationComponentAction.OnPerformLocationComponentAction {
override fun onLocationComponentAction(component: LocationComponent, mapboxMap: MapboxMap,
style: Style, uiController: UiController, context: Context) {
- assertThat(component.isLocationComponentEnabled, `is`(false))
+
component.onStop()
component.onStart()
- assertThat(component.isLocationComponentEnabled, `is`(false))
component.activateLocationComponent(LocationComponentActivationOptions
.builder(context, style)
.useDefaultLocationEngine(false)
.build())
+
+ assertThat(component.isLocationComponentEnabled, `is`(false))
+ component.onStop()
+ component.onStart()
+ assertThat(component.isLocationComponentEnabled, `is`(false))
+
component.isLocationComponentEnabled = true
assertThat(component.isLocationComponentEnabled, `is`(true))
}