mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
WebDriver: Wait focus to complete when switching window (#38160)
Previously the webdriver do not wait for focus to complete, which can cause some instability. No matter interact as human or webdriver, the focus chain always goes as: Embedder forwards -> Constellation (do some updates) -> Embedder (do some updates). --------- Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
7c96084298
commit
b0a29393a9
10 changed files with 48 additions and 23 deletions
|
@ -377,13 +377,10 @@ impl App {
|
|||
WebDriverCommandMsg::CloseWebView(webview_id) => {
|
||||
running_state.close_webview(webview_id);
|
||||
},
|
||||
WebDriverCommandMsg::FocusWebView(webview_id) => {
|
||||
WebDriverCommandMsg::FocusWebView(webview_id, response_sender) => {
|
||||
if let Some(webview) = running_state.webview_by_id(webview_id) {
|
||||
webview.focus();
|
||||
webview.focus_from_webdriver(response_sender);
|
||||
}
|
||||
|
||||
// TODO: send a response to the WebDriver
|
||||
// so it knows when the focus has finished.
|
||||
},
|
||||
WebDriverCommandMsg::GetWindowRect(_webview_id, response_sender) => {
|
||||
let window = self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue