зеркало из https://github.com/mozilla/gecko-dev.git
Bug 943705 - Aggregate countdown timer in waitForPageLoad. r=mcomella
This commit is contained in:
Родитель
64f9baab02
Коммит
95b0d6c4f6
|
@ -100,17 +100,21 @@ public final class WaitHelper {
|
|||
expecter.unregisterListener();
|
||||
}
|
||||
|
||||
// The timeout wait time should be the aggregate time for all ChangeVerifiers.
|
||||
final long verifierStartMillis = SystemClock.uptimeMillis();
|
||||
|
||||
// Verify remaining state has changed.
|
||||
for (final ChangeVerifier verifier : pageLoadVerifiers) {
|
||||
// If we timeout, either the state is set to the same value (which is fine), or
|
||||
// the state has not yet changed. Since we can't be sure it will ever change, move
|
||||
// on and let the assertions fail if applicable.
|
||||
final int verifierWaitMillis = CHANGE_WAIT_MS - (int)(SystemClock.uptimeMillis() - verifierStartMillis);
|
||||
final boolean hasTimedOut = !sSolo.waitForCondition(new Condition() {
|
||||
@Override
|
||||
public boolean isSatisfied() {
|
||||
return verifier.hasStateChanged();
|
||||
}
|
||||
}, CHANGE_WAIT_MS);
|
||||
}, verifierWaitMillis);
|
||||
|
||||
sContext.dumpLog(verifier.getLogTag(),
|
||||
(hasTimedOut ? "timed out." : "was satisfied."));
|
||||
|
|
Загрузка…
Ссылка в новой задаче