summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-10-31 10:16:13 +0100
committerTobrun <tobrun.van.nuland@gmail.com>2018-10-31 10:16:13 +0100
commit4dc96276f52448cb459f3ea3a6d32c7e49835d83 (patch)
tree04d0b7ccdae206f3d9e7f4f1eb6300a69abdba5c
parent3f314682fa2f2701c0d1c7e863013ce254a23afd (diff)
downloadqtlocation-mapboxgl-upstream/tvn-remove-wait-for-layer.tar.gz
[android] - remove wait for layer in expression testsupstream/tvn-remove-wait-for-layer
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/ExpressionTest.java39
1 files changed, 0 insertions, 39 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/ExpressionTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/ExpressionTest.java
index 0574f3e8e4..3fc4d73d22 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/ExpressionTest.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/ExpressionTest.java
@@ -290,9 +290,6 @@ public class ExpressionTest extends BaseActivityTest {
formatEntry("test")
);
layer.setProperties(textField(expression));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer")
- .isEmpty());
assertNull(layer.getTextField().getExpression());
assertEquals("test", layer.getTextField().getValue());
@@ -318,9 +315,6 @@ public class ExpressionTest extends BaseActivityTest {
formatEntry("test", formatFontScale(1.75))
);
layer.setProperties(textField(expression));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer")
- .isEmpty());
assertNull(layer.getTextField().getExpression());
assertEquals("test", layer.getTextField().getValue());
@@ -350,10 +344,6 @@ public class ExpressionTest extends BaseActivityTest {
)
);
layer.setProperties(textField(expression));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(
- mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer").isEmpty()
- );
assertNull(layer.getTextField().getExpression());
assertEquals("test", layer.getTextField().getValue());
@@ -384,10 +374,6 @@ public class ExpressionTest extends BaseActivityTest {
)
);
layer.setProperties(textField(expression));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(
- mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer").isEmpty()
- );
assertNull(layer.getTextField().getExpression());
assertEquals("test", layer.getTextField().getValue());
@@ -417,10 +403,6 @@ public class ExpressionTest extends BaseActivityTest {
formatEntry("\ntest2", formatFontScale(2))
);
layer.setProperties(textField(expression));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(
- mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer").isEmpty()
- );
assertNull(layer.getTextField().getExpression());
assertEquals("test\ntest2", layer.getTextField().getValue());
@@ -454,9 +436,6 @@ public class ExpressionTest extends BaseActivityTest {
)
);
layer.setProperties(textField(expression));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer")
- .isEmpty());
assertEquals(expression, layer.getTextField().getExpression());
assertNull(layer.getTextField().getValue());
@@ -487,9 +466,6 @@ public class ExpressionTest extends BaseActivityTest {
formatEntry("\ntest2", formatFontScale(2))
);
layer.setProperties(textField(expression));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer")
- .isEmpty());
assertEquals(expression, layer.getTextField().getExpression());
assertNull(layer.getTextField().getValue());
@@ -509,9 +485,6 @@ public class ExpressionTest extends BaseActivityTest {
mapboxMap.addLayer(layer);
layer.setProperties(textField("test"));
- waitForLayer(uiController, mapboxMap, latLng);
- assertFalse(mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer")
- .isEmpty());
assertNull(layer.getTextField().getExpression());
assertEquals("test", layer.getTextField().getValue());
@@ -522,18 +495,6 @@ public class ExpressionTest extends BaseActivityTest {
});
}
- private static final long WAIT_TIMEOUT = 5000;
- private static final long WAIT_DELAY = 150;
-
- private static void waitForLayer(UiController uiController, MapboxMap mapboxMap, LatLng latLng) {
- int i = 0;
- while (mapboxMap.queryRenderedFeatures(mapboxMap.getProjection().toScreenLocation(latLng), "layer").isEmpty()) {
- i++;
- assertFalse("Waiting for layer timed out", i * WAIT_DELAY > WAIT_TIMEOUT);
- uiController.loopMainThreadForAtLeast(WAIT_DELAY);
- }
- }
-
private void setupStyle() {
invoke(mapboxMap, (uiController, mapboxMap) -> {
// Add a source