webdriver: Add handle any user prompts step for all commands (#38035)

- Add `handler any user prompt` step for all commands.
- Enable webdriver tests which were blocked by `handle any user prompt`
step.

---------

Signed-off-by: batu_hoang <hoang.binh.trong@huawei.com>
This commit is contained in:
batu_hoang 2025-07-17 17:47:47 +08:00 committed by GitHub
parent 18d1a62add
commit 345733a5c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 859 additions and 472 deletions

View file

@ -14,7 +14,7 @@ use servo::servo_geometry::DeviceIndependentPixel;
use servo::{
AlertResponse, AuthenticationRequest, ColorPicker, ConfirmResponse, FilterPattern,
PermissionRequest, PromptResponse, RgbColor, SelectElement, SelectElementOption,
SelectElementOptionOrOptgroup, SimpleDialog,
SelectElementOptionOrOptgroup, SimpleDialog, WebDriverUserPrompt,
};
pub enum Dialog {
@ -582,6 +582,16 @@ impl Dialog {
},
}
}
pub fn webdriver_diaglog_type(&self) -> WebDriverUserPrompt {
match self {
Dialog::File { .. } => WebDriverUserPrompt::File,
Dialog::SimpleDialog(SimpleDialog::Alert { .. }) => WebDriverUserPrompt::Alert,
Dialog::SimpleDialog(SimpleDialog::Confirm { .. }) => WebDriverUserPrompt::Confirm,
Dialog::SimpleDialog(SimpleDialog::Prompt { .. }) => WebDriverUserPrompt::Prompt,
_ => WebDriverUserPrompt::Default,
}
}
}
fn make_dialog_label(message: &str, ui: &mut egui::Ui, input_text: Option<&mut String>) {