From 4db5f6d081af0cd24edcae5224155f3dee5a3429 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 19 Oct 2022 16:53:06 +0200 Subject: [PATCH] WebDriver: Use monotonic timer in Session::find() --- Userland/Services/WebDriver/Session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Services/WebDriver/Session.cpp b/Userland/Services/WebDriver/Session.cpp index b68cb250f3..d7a6e31174 100644 --- a/Userland/Services/WebDriver/Session.cpp +++ b/Userland/Services/WebDriver/Session.cpp @@ -10,7 +10,7 @@ #include "Session.h" #include "BrowserConnection.h" #include "Client.h" -#include +#include #include #include #include @@ -266,7 +266,7 @@ static JsonObject web_element_reference_object(Session::LocalElement const& elem ErrorOr Session::find(Session::LocalElement const& start_node, StringView const& using_, StringView const& value) { // 1. Let end time be the current time plus the session implicit wait timeout. - auto end_time = Core::DateTime::from_timestamp(Core::DateTime::now().timestamp() + m_timeouts_configuration.implicit_wait_timeout / 1000); + auto end_time = Time::now_monotonic() + Time::from_milliseconds(static_cast(m_timeouts_configuration.implicit_wait_timeout)); // 2. Let location strategy be equal to using. auto location_strategy = using_;