aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/test/firebase/firestore/remote/exponential_backoff_test.cc
Commit message (Collapse)AuthorAge
* C++ migration: add a C++ implementation of `FSTExponentialBackoff` (#1465)Gravatar Konstantin Varlamov2018-07-10
This is a pretty close port of `FSTExponentialBackoff`. The changes are pretty minor: * delay is calculated using <chrono> duration types, not plain numbers, which should be a little more type-safe; * split a piece of code into a ClampDelay function, because it's reasonably close to std::clamp; * rephrased the class-level comment to make it clearer that the first attempt always has delay = 0; * added simple tests (other platforms don't have tests for this). Also make sure that canceling a DelayedOperation is always valid.