webdriver: Implement support for simple dialogs (#37913)

Implement webdriver user prompt: accept alert, dismiss alert, get alert
text.

Tests:
https://github.com/longvatrong111/servo/actions/runs/16175408035
https://github.com/longvatrong111/servo/actions/runs/16175409545

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
batu_hoang 2025-07-10 11:15:46 +08:00 committed by GitHub
parent 84f0cd5801
commit 2e44aba753
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 296 additions and 42 deletions

View file

@ -140,6 +140,34 @@ impl Dialog {
}
}
pub fn accept(&self) {
#[allow(clippy::single_match)]
match self {
Dialog::SimpleDialog(dialog) => {
dialog.accept();
},
_ => {},
}
}
pub fn dismiss(&self) {
#[allow(clippy::single_match)]
match self {
Dialog::SimpleDialog(dialog) => {
dialog.dismiss();
},
_ => {},
}
}
pub fn message(&self) -> Option<String> {
#[allow(clippy::single_match)]
match self {
Dialog::SimpleDialog(dialog) => Some(dialog.message().to_string()),
_ => None,
}
}
pub fn update(&mut self, ctx: &egui::Context) -> bool {
match self {
Dialog::File {