webdriver: Implement send alert text (#38140)

Implement webdriver `SendAlertText` command

Tests:
https://github.com/longvatrong111/servo/actions/runs/16342669929
https://github.com/longvatrong111/servo/actions/runs/16342671477

cc: @xiaochengh

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
batu_hoang 2025-07-18 05:24:50 +08:00 committed by GitHub
parent 3ce95b2ba5
commit f0e10e63e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 91 additions and 46 deletions

View file

@ -172,6 +172,14 @@ impl SimpleDialog {
}
}
pub fn set_message(&mut self, text: String) {
match self {
SimpleDialog::Alert { message, .. } => *message = text,
SimpleDialog::Confirm { message, .. } => *message = text,
SimpleDialog::Prompt { message, .. } => *message = text,
}
}
pub fn dismiss(&self) {
match self {
SimpleDialog::Alert {

View file

@ -166,6 +166,7 @@ pub enum WebDriverCommandMsg {
IpcSender<Result<Option<String>, ()>>,
),
GetAlertText(WebViewId, IpcSender<Result<String, ()>>),
SendAlertText(WebViewId, String),
AddLoadStatusSender(WebViewId, IpcSender<WebDriverLoadStatus>),
RemoveLoadStatusSender(WebViewId),
}