mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -68,8 +68,9 @@ pub enum EmbedderToConstellationMessage {
|
|||
CloseWebView(WebViewId),
|
||||
/// Panic a top level browsing context.
|
||||
SendError(Option<WebViewId>, String),
|
||||
/// Make a webview focused.
|
||||
FocusWebView(WebViewId),
|
||||
/// Make a webview focused. If sender is provided, it will be used to send back a
|
||||
/// bool indicating whether the focus was successfully set in EmbedderMsg::WebViewFocused.
|
||||
FocusWebView(WebViewId, Option<IpcSender<bool>>),
|
||||
/// Make none of the webviews focused.
|
||||
BlurWebView,
|
||||
/// Forward an input event to an appropriate ScriptTask.
|
||||
|
|
|
@ -373,7 +373,9 @@ pub enum EmbedderMsg {
|
|||
/// A webview was destroyed.
|
||||
WebViewClosed(WebViewId),
|
||||
/// A webview gained focus for keyboard events
|
||||
WebViewFocused(WebViewId),
|
||||
/// If sender is provided, it will be used to send back a
|
||||
/// bool indicating whether the focus was successfully set.
|
||||
WebViewFocused(WebViewId, Option<IpcSender<bool>>),
|
||||
/// All webviews lost focus for keyboard events.
|
||||
WebViewBlurred,
|
||||
/// Wether or not to unload a document
|
||||
|
|
|
@ -152,7 +152,8 @@ pub enum WebDriverCommandMsg {
|
|||
/// Close the webview associated with the provided id.
|
||||
CloseWebView(WebViewId),
|
||||
/// Focus the webview associated with the provided id.
|
||||
FocusWebView(WebViewId),
|
||||
/// Sends back a bool indicating whether the focus was successfully set.
|
||||
FocusWebView(WebViewId, IpcSender<bool>),
|
||||
/// Get focused webview.
|
||||
GetFocusedWebView(IpcSender<Option<WebViewId>>),
|
||||
/// Check whether top-level browsing context is open.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue