Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriver: Spec wants "dispatch actions inner" to throw exceptions #3114

Open
AtkinsSJ opened this issue Jan 3, 2025 · 1 comment
Open

Comments

@AtkinsSJ
Copy link
Member

AtkinsSJ commented Jan 3, 2025

See spec change at w3c/webdriver#1861

I had a quick go at implementing this but our code implements the waiting step by queueing tasks, which is incompatible with returning an exception in this way. So leaving it for someone who understands this code better. cc: @trflynn89

@trflynn89
Copy link
Contributor

trflynn89 commented Jan 3, 2025

Oh that should be pretty straight forward - we have a hook to send exceptions back to the client at any point in the async chain. Something like:

// 1. If browsing context is no longer open, return error with error code no such window.
if (m_browsing_context->has_navigable_been_destroyed()) {
    m_on_complete->function()(WebDriver::Error::from_code(WebDriver::ErrorCode::NoSuchWindow, "Window has been closed"sv));
    return;
}

// 2. Let tick duration be the result of computing the tick duration with argument tick actions.
auto tick_duration = compute_tick_duration(tick_actions);

(In an actual PR, note that we have a helper for the "browsing context is open" check in WebDriverConnection.cpp that we should probably move some place public and use here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants