mirror of
https://github.com/servo/servo.git
synced 2025-07-19 13:23:46 +01:00
webdriver: Allow script thread to fail to send response for ExecuteScript
(#38054)
When script thread executes script sent from webdriver, if an alert appears, webdriver can stop waiting for the script response and process the next command. This PR allows script thread to fail to send response for `ExecuteScript` if the channel is closed. cc: @xiaochengh Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
This commit is contained in:
parent
1cd249dfe9
commit
aa098ba2a3
3 changed files with 8 additions and 28 deletions
|
@ -528,12 +528,17 @@ pub(crate) fn handle_execute_script(
|
|||
Err(WebDriverJSError::JSError)
|
||||
};
|
||||
|
||||
reply.send(result).unwrap();
|
||||
if reply.send(result).is_err() {
|
||||
info!("Webdriver might already be released by embedder before reply is sent");
|
||||
};
|
||||
},
|
||||
None => {
|
||||
reply
|
||||
if reply
|
||||
.send(Err(WebDriverJSError::BrowsingContextNotFound))
|
||||
.unwrap();
|
||||
.is_err()
|
||||
{
|
||||
info!("Webdriver might already be released by embedder before reply is sent");
|
||||
};
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,6 @@
|
|||
[execute.py]
|
||||
expected: TIMEOUT
|
||||
[test_no_browsing_context]
|
||||
expected: FAIL
|
||||
|
||||
[test_opening_new_window_keeps_current_window_handle]
|
||||
expected: FAIL
|
||||
|
||||
[test_abort_by_user_prompt[alert\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_abort_by_user_prompt[confirm\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_abort_by_user_prompt[prompt\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_abort_by_user_prompt_twice[alert\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_abort_by_user_prompt_twice[confirm\]]
|
||||
expected: FAIL
|
||||
|
||||
[test_abort_by_user_prompt_twice[prompt\]]
|
||||
expected: FAIL
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
[switch.py]
|
||||
[test_finds_exising_user_prompt_after_tab_switch[confirm\]]
|
||||
expected: ERROR
|
||||
|
||||
[test_finds_exising_user_prompt_after_tab_switch[prompt\]]
|
||||
expected: ERROR
|
Loading…
Add table
Add a link
Reference in a new issue