WebContent: Handle user prompts in the Take Screenshot endpoint

This is a spec issue, and WPT relies on this behavior.
This commit is contained in:
Timothy Flynn 2024-11-05 08:56:27 -05:00 committed by Andreas Kling
parent f4111ef1e1
commit 3afd88330b
Notes: github-actions[bot] 2024-11-06 09:51:24 +00:00

View file

@ -2409,6 +2409,9 @@ Messages::WebDriverClient::TakeScreenshotResponse WebDriverConnection::take_scre
// 1. If session's current top-level browsing context is no longer open, return error with error code no such window.
TRY(ensure_current_top_level_browsing_context_is_open());
// FIXME: Spec issue: We must handle user prompts in this endpoint, just like we do in Take Element Screenshot.
// https://github.com/w3c/webdriver/issues/1678
handle_any_user_prompts([this]() {
auto* document = current_top_level_browsing_context()->active_document();
auto window = document->window();
@ -2428,6 +2431,7 @@ Messages::WebDriverClient::TakeScreenshotResponse WebDriverConnection::take_scre
// 3. Return success with data encoded string.
async_driver_execution_complete(move(encoded_string));
}));
});
return JsonValue {};
}