diff --git a/components/script/webdriver_handlers.rs b/components/script/webdriver_handlers.rs index 1cd253d4eec..7c6677cc6b9 100644 --- a/components/script/webdriver_handlers.rs +++ b/components/script/webdriver_handlers.rs @@ -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"); + }; }, } } diff --git a/tests/wpt/meta/webdriver/tests/classic/execute_script/execute.py.ini b/tests/wpt/meta/webdriver/tests/classic/execute_script/execute.py.ini index ff13c80a5fe..d5462080853 100644 --- a/tests/wpt/meta/webdriver/tests/classic/execute_script/execute.py.ini +++ b/tests/wpt/meta/webdriver/tests/classic/execute_script/execute.py.ini @@ -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 diff --git a/tests/wpt/meta/webdriver/tests/classic/switch_to_window/switch.py.ini b/tests/wpt/meta/webdriver/tests/classic/switch_to_window/switch.py.ini deleted file mode 100644 index ba3819d135b..00000000000 --- a/tests/wpt/meta/webdriver/tests/classic/switch_to_window/switch.py.ini +++ /dev/null @@ -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