UpdateManager: Fix update scheduling interval/fuzz inference.
This addresses two differences wrt current logic:
* In the case of recurring periodic check, we should use
kTimeoutPeriodicInterval as the base check interval (and not
kTimeoutInitialInterval).
* When doing exponential backoff, we should be using the interval / 2 as
the fuzz factor (and not the fixed kTimeoutRegularFuzz).
Added two new tests (RecurringCheckBaseIntervalAndFuzz and
RecurringCheckBackoffIntervalAndFuzz) to ensure the correct values are
used.
Also fixed existing unit tests to properly distinguish a first update
check from recurring ones (FirstCheckIsAtMostInitialIntervalAfterStart)
and to properly verify that deferred update check times are within the
expected buzz boundaries (FirstCheckIsAtMostInitialIntervalAfterStart
and ExponentialBackoffIsCapped).
BUG=chromium:392582
TEST=Unit tests.
Change-Id: I3085502c57616cba2eff4cb0372ca5699427ae20
Reviewed-on: https://chromium-review.googlesource.com/207192
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
3 files changed