1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 12:51:16 +00:00

Check current state (and wait a bit longer) in the SyncthingService unit test

This commit is contained in:
Lode Hoste 2015-03-24 22:26:17 +01:00
parent 3784134bea
commit fadd22148a

View file

@ -66,10 +66,11 @@ public class SyncthingServiceTest extends ServiceTestCase<SyncthingService> {
getService().registerOnApiChangeListener(new SyncthingService.OnApiChangeListener() { getService().registerOnApiChangeListener(new SyncthingService.OnApiChangeListener() {
@Override @Override
public void onApiChange(SyncthingService.State currentState) { public void onApiChange(SyncthingService.State currentState) {
latch.countDown(); if (currentState == SyncthingService.State.ACTIVE)
latch.countDown();
} }
}); });
latch.await(1, TimeUnit.SECONDS); latch.await(10, TimeUnit.SECONDS);
assertNotNull(getService().getApi()); assertNotNull(getService().getApi());
assertNotNull(getService().getWebGuiUrl()); assertNotNull(getService().getWebGuiUrl());
} }