LibWeb: Correctly test if WebDriver ExecuteScript timeout is reached

Previously, the conversion assumed that the supplied timeout was in
seconds rather than milliseconds.
This commit is contained in:
Tim Ledbetter
2024-08-27 20:25:14 +01:00
committed by Tim Ledbetter
parent ba36312864
commit b688b5d9d4

View File

@@ -332,7 +332,7 @@ ExecuteScriptResultSerialized execute_async_script(Web::Page& page, ByteString c
auto start = MonotonicTime::now(); auto start = MonotonicTime::now();
auto has_timed_out = [&] { auto has_timed_out = [&] {
return timeout.has_value() && (MonotonicTime::now() - start) > AK::Duration::from_seconds(static_cast<i64>(*timeout)); return timeout.has_value() && (MonotonicTime::now() - start) > AK::Duration::from_milliseconds(static_cast<i64>(*timeout));
}; };
// AD-HOC: An execution context is required for Promise creation hooks. // AD-HOC: An execution context is required for Promise creation hooks.