Fix timeout in a test utility method

Bug 29612099

Change-Id: Ic09a280de33dd58569f5b57242f27ece6d74c120
This commit is contained in:
Makoto Onuki
2016-07-27 14:08:48 -07:00
parent 4898bf964d
commit a210ccfab7

View File

@@ -1055,6 +1055,9 @@ public class ShortcutManagerTestUtils {
public static void retryUntil(BooleanSupplier checker, String message) {
final long timeOut = System.currentTimeMillis() + 30 * 1000; // wait for 30 seconds.
while (!checker.getAsBoolean()) {
if (System.currentTimeMillis() > timeOut) {
break;
}
try {
Thread.sleep(200);
} catch (InterruptedException ignore) {