summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/Utils.java
diff options
context:
space:
mode:
authorŁukasz Paczos <lukas.paczos@gmail.com>2019-02-06 12:47:04 +0100
committerŁukasz Paczos <lukas.paczos@gmail.com>2019-02-06 12:59:32 +0100
commit8cb99d4722ee1bc876a25a6d878ada8d5b0b8c5c (patch)
tree6e9f5943bbec7569a5f6cb022bade95670c93911 /platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/Utils.java
parent47852b6c42b7884dbb7ad107a112c7e0d9f96ed0 (diff)
downloadqtlocation-mapboxgl-upstream/lp-13881-negative-conversion.tar.gz
[android] cast round json element properties to int64_t instead of the uint64_tupstream/lp-13881-negative-conversion
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/Utils.java')
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/Utils.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/Utils.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/Utils.java
new file mode 100644
index 0000000000..1ca4f0df87
--- /dev/null
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/utils/Utils.java
@@ -0,0 +1,23 @@
+package com.mapbox.mapboxsdk.testapp.utils;
+
+import android.support.test.espresso.UiController;
+
+import com.mapbox.mapboxsdk.geometry.LatLng;
+import com.mapbox.mapboxsdk.maps.MapboxMap;
+
+import static org.junit.Assert.assertFalse;
+
+public class Utils {
+
+ private static final long WAIT_TIMEOUT = 5000;
+ private static final long WAIT_DELAY = 150;
+
+ public static void waitForLayer(UiController uiController, MapboxMap mapboxMap, LatLng latLng, String... layerIds) {
+ int i = 0;
+ while (mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), layerIds).isEmpty()) {
+ i++;
+ assertFalse("Waiting for layer timed out", i * WAIT_DELAY > WAIT_TIMEOUT);
+ uiController.loopMainThreadForAtLeast(WAIT_DELAY);
+ }
+ }
+}