mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +00:00
2689c838af
Clock now has a single now() function that returns a std::time::Instant rather than wrapping an Instant itself. FakeClock provides the same now() API, except the Instant it reports is only advanced when test code calls add_ns(). FakeClock continues to provide the add_event() and add_ns() APIs used by tests. The only functional difference is that the epoch used by FakeClock is now whatever moment in (real) time it is created, rather than a fixed timestamp, but this should not change the results of the tests. The only way to observe the contents of an Instant is by comparing it to other Instants, which should all be derived from the Clock/FakeClock now() API. BUG=None TEST=cargo test -p base -- --test-threads=1 TEST=cargo test -p devices Change-Id: I9a0ed8d252f213d85dba3dfbbcd1182e2db981f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3736922 Reviewed-by: Noah Gold <nkgold@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> |
||
---|---|---|
.. | ||
base_event_token_derive | ||
src | ||
.build_test_serial | ||
Cargo.toml |