1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 15:27:34 +00:00

Everywhere: Use MonotonicTime instead of Duration

This is easily identifiable by anyone who uses Duration::now_monotonic,
and any downstream users of that data.
This commit is contained in:
kleines Filmröllchen 2023-03-17 19:50:39 +01:00 committed by Jelle Raaijmakers
parent b2e7b8cdff
commit fc5cab5c21
29 changed files with 79 additions and 80 deletions

View file

@ -1958,7 +1958,7 @@ Gfx::IntRect WebDriverConnection::iconify_the_window()
ErrorOr<JsonArray, Web::WebDriver::Error> WebDriverConnection::find(StartNodeGetter&& start_node_getter, Web::WebDriver::LocationStrategy using_, StringView value)
{
// 1. Let end time be the current time plus the session implicit wait timeout.
auto end_time = Duration::now_monotonic() + Duration::from_milliseconds(static_cast<i64>(m_timeouts_configuration.implicit_wait_timeout));
auto end_time = MonotonicTime::now() + Duration::from_milliseconds(static_cast<i64>(m_timeouts_configuration.implicit_wait_timeout));
// 2. Let location strategy be equal to using.
auto location_strategy = using_;
@ -1985,7 +1985,7 @@ ErrorOr<JsonArray, Web::WebDriver::Error> WebDriverConnection::find(StartNodeGet
return true;
// 6. If elements returned is empty and the current time is less than end time return to step 4. Otherwise, continue to the next step.
return maybe_elements.value()->length() != 0 || Duration::now_monotonic() >= end_time;
return maybe_elements.value()->length() != 0 || MonotonicTime::now() >= end_time;
});
auto elements = TRY(maybe_elements);