From 4c511ee9713528b627cf70aeedb7c4e3718eb800 Mon Sep 17 00:00:00 2001 From: Kevin Li Date: Thu, 14 May 2020 17:30:38 +0800 Subject: [PATCH] Update unstable location tests (#383) --- .../mapbox/mapboxsdk/location/LocationComponentTest.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt b/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt index 18206de7f..7c1bfc4bc 100644 --- a/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt +++ b/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationComponentTest.kt @@ -382,6 +382,10 @@ class LocationComponentTest : EspressoTest() { uiController: UiController, context: Context ) { + val foregroundDrawable = BitmapUtils.getDrawableFromRes(context, R.drawable.ic_media_play) + foregroundDrawable?.let { + mapboxMap.addImageFromDrawable("custom-gps-bitmap", it) + } locationComponentActivationOptions = LocationComponentActivationOptions .builder(context, style) .useDefaultLocationEngine(false) @@ -422,6 +426,10 @@ class LocationComponentTest : EspressoTest() { uiController: UiController, context: Context ) { + val foregroundDrawable = BitmapUtils.getDrawableFromRes(context, R.drawable.ic_media_play) + foregroundDrawable?.let { + mapboxMap.addImageFromDrawable("custom-gps-bitmap", it) + } locationComponentActivationOptions = LocationComponentActivationOptions .builder(context, style) .useDefaultLocationEngine(false) @@ -1008,7 +1016,7 @@ class LocationComponentTest : EspressoTest() { component.forceLocationUpdate(location) TestingAsyncUtils.waitForLayer(uiController, mapView) uiController.loopMainThreadForAtLeast(MAX_ANIMATION_DURATION_MS) // Waiting for the animation to finish - assertEquals(92.0f, mapboxMap.querySourceFeatures(LOCATION_SOURCE)[0].getNumberProperty(PROPERTY_GPS_BEARING).toFloat(), 0.1f) + assertEquals(92.0f, mapboxMap.querySourceFeatures(LOCATION_SOURCE)[0].getNumberProperty(PROPERTY_GPS_BEARING).toFloat(), 0.5f) } }