Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 87c1e2d36d8ebea77db4fb0914eb7353970d8fc8
      
https://github.com/WebKit/WebKit/commit/87c1e2d36d8ebea77db4fb0914eb7353970d8fc8
  Author: Lauro Moura <[email protected]>
  Date:   2026-10-02 (Fri, 02 Oct 2026)

  Changed paths:
    M Source/WebDriver/WebDriverService.cpp
    M Source/WebDriver/WebDriverService.h

  Log Message:
  -----------
  [WebDriver] Ensure classic commands on a given session are queued during 
execution
https://bugs.webkit.org/show_bug.cgi?id=323444

Reviewed by Carlos Garcia Campos.

This commit adds support for queueing incoming WebDriver classic
commands, as required by the spec. Commands that don't require an
existing session like `POST /session` (new session) and `GET /status`
are dispatched immediately.

Regarding the "new session" command, the exception is when the driver
was given the "--replace-on-new-session" flag. In this scenario, the
"new session" is added to the queue after flushing the pending commands
that have not yet been dispatched. Note that an already running command
is not interrupted as it could leave the browser in an inconsistent
state.

Previously, the main synchronization mechanism for WebDriver classic was
waiting for the navigation to complete, and dispatching the commands
concurrently was prone to race conditions making it difficult to
identify the actual command behind a timeout. Now, on the other hand, a
stuck command freezes the whole queue. So, other than the spec-defined
timeouts (load, script, element retrieval), the client harness must have
means to recover from such freezes.

* Source/WebDriver/WebDriverService.cpp:
(WebDriver::WebDriverService::~WebDriverService):
(WebDriver::WebDriverService::handleRequest):
(WebDriver::WebDriverService::enqueueOrDispatchRequest):
(WebDriver::WebDriverService::dispatchNextPendingRequest):
(WebDriver::WebDriverService::flushRequestQueueWithResult):
* Source/WebDriver/WebDriverService.h:

Canonical link: https://commits.webkit.org/322485@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to