handle Done promises correctly

This commit is contained in:
Gregory.Shrago
2017-10-12 20:29:33 +03:00
parent df6616eb4e
commit 1dc63be083
@@ -258,7 +258,7 @@ public class PlatformTestUtil {
promise.processed(ignore -> complete.set(true));
T result = null;
long start = System.currentTimeMillis();
while (!complete.get()) {
do {
UIUtil.dispatchAllInvocationEvents();
try {
result = promise.blockingGet(20, TimeUnit.MILLISECONDS);
@@ -269,6 +269,7 @@ public class PlatformTestUtil {
throw new AssertionError("The promise takes too long... aborting");
}
}
while (!complete.get());
UIUtil.dispatchAllInvocationEvents();
return result;
}