Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import com.mparticle.testutils.BaseCleanStartedEachTest;
import com.mparticle.testutils.BuildConfig;
import com.mparticle.testutils.MPLatch;

import java.util.concurrent.TimeUnit;
import com.mparticle.testutils.RandomUtils;

import org.json.JSONArray;
Expand Down Expand Up @@ -68,6 +70,7 @@ public class MParticleJSInterfaceITest extends BaseCleanStartedEachTest {
private static boolean sdkFetchedSuccessfully = false;
private static String bridgeToken = new RandomUtils().getAlphaString(5);
private static String bridgeVersion = "2";
private static final int WEBVIEW_TIMEOUT_SECONDS = 30;

private static final String jsStartupMParticle = "window.mParticle = {\n" +
" config: {\n" +
Expand Down Expand Up @@ -238,7 +241,7 @@ public void setUserAttribute(String json) {

}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand All @@ -263,7 +266,7 @@ public void removeUserAttribute(String json) {
}
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand Down Expand Up @@ -304,7 +307,7 @@ public void setUserAttribute(String json) {
}
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand Down Expand Up @@ -361,7 +364,7 @@ public void logEvent(String json) {
}
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand Down Expand Up @@ -443,7 +446,7 @@ public void logEvent(String json) {
}
});
assertNull(error.value);
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand All @@ -470,7 +473,7 @@ public void logout(String json) {
}
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand All @@ -496,7 +499,7 @@ public void logout() {
latch.countDown();
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand All @@ -522,7 +525,7 @@ public void login(String json) {
}
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand All @@ -548,7 +551,7 @@ public void login() {
latch.countDown();
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand All @@ -574,7 +577,7 @@ public void modify(String json) {
}
}
});
latch.await();
latch.await(WEBVIEW_TIMEOUT_SECONDS, TimeUnit.SECONDS);
assertTrue(called.value);
}

Expand Down
Loading