webdriver: Rename wait_for_script_response to wait_for_ipc_response (#38537)

As titled. Initially I want to include this as part of another PR but
looks so messy..
The motivation is that we are no longer just waiting for script
response.

Testing: No behaviour change.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-08-08 17:49:57 +08:00 committed by GitHub
parent 6651f37c05
commit 31acac316d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 48 additions and 50 deletions

View file

@ -12,7 +12,7 @@ use serde_json::{Map, Value};
use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult};
use webdriver::response::{ValueResponse, WebDriverResponse};
use crate::{Handler, wait_for_script_response};
use crate::{Handler, wait_for_ipc_response};
const KNOWN_PROMPT_HANDLERS: [&str; 5] = [
"dismiss",
@ -188,7 +188,7 @@ impl Handler {
sender,
))?;
match wait_for_script_response(receiver)? {
match wait_for_ipc_response(receiver)? {
// Step 2. If the current user prompt is null, return error with error code no such alert.
Err(()) => Err(WebDriverError::new(
ErrorStatus::NoSuchAlert,
@ -213,7 +213,7 @@ impl Handler {
sender,
))?;
match wait_for_script_response(receiver)? {
match wait_for_ipc_response(receiver)? {
// Step 2. If the current user prompt is null, return error with error code no such alert.
Err(()) => Err(WebDriverError::new(
ErrorStatus::NoSuchAlert,
@ -236,7 +236,7 @@ impl Handler {
sender,
))?;
match wait_for_script_response(receiver)? {
match wait_for_ipc_response(receiver)? {
// Step 2. If the current user prompt is null, return error with error code no such alert.
Err(()) => Err(WebDriverError::new(
ErrorStatus::NoSuchAlert,
@ -271,7 +271,7 @@ impl Handler {
self.send_message_to_embedder(WebDriverCommandMsg::CurrentUserPrompt(webview_id, sender))?;
match wait_for_script_response(receiver)? {
match wait_for_ipc_response(receiver)? {
// Step 4. If the current user prompt is null, return error with error code no such alert.
None => Err(WebDriverError::new(
ErrorStatus::NoSuchAlert,
@ -315,7 +315,7 @@ impl Handler {
self.send_message_to_embedder(WebDriverCommandMsg::CurrentUserPrompt(webview_id, sender))?;
match wait_for_script_response(receiver)? {
match wait_for_ipc_response(receiver)? {
// Step 1. If the current user prompt is null, return success with data null.
None => Ok(WebDriverResponse::Void),
Some(prompt_type) => {
@ -333,7 +333,7 @@ impl Handler {
if handler.notify || handler.handler == WebDriverUserPromptAction::Ignore {
// Step 6. If handler's notify is true, return annotated unexpected alert open error.
let alert_text = wait_for_script_response(receiver)?
let alert_text = wait_for_ipc_response(receiver)?
.unwrap_or_default()
.unwrap_or_default();