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 <lukasz.paczos@mapbox.com>2019-03-11 13:30:59 +0100
commit5ccc5b7c360827fe58698c28cae4df399310e4d1 (patch)
tree468d052f0e6ef1328f2446cef23493d2c5166c0f /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt
parent278347548daa7314e2367364d55f1090d5bab9a9 (diff)
downloadqtlocation-mapboxgl-5ccc5b7c360827fe58698c28cae4df399310e4d1.tar.gz
[android] throw an exception if the component is accessed before the activation
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))
}