mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
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:
parent
84f0cd5801
commit
2e44aba753
9 changed files with 296 additions and 42 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue