Basic webdriver support to servoshell on ohos (#38386)

Adding basic webdriver support to servoshell on ohos and basic
communication between the ohos device and script.

Testing: Manual testing and tracing logs

Signed-off-by: abdelrahman1234567 <abdelrahman.hossameldin.awadalla@huawei.com>
This commit is contained in:
Abdelrahman Hossam 2025-08-12 14:26:53 +08:00 committed by GitHub
parent f5b631e270
commit 2e2bfc6067
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 113 additions and 17 deletions

View file

@ -11,7 +11,7 @@
pub mod input_events;
pub mod resources;
pub mod user_content_manager;
mod webdriver;
pub mod webdriver;
use std::collections::HashMap;
use std::ffi::c_void;

View file

@ -23,7 +23,7 @@ use webdriver::common::{WebElement, WebFrame, WebWindow};
use webdriver::error::ErrorStatus;
use webrender_api::units::DevicePixel;
use crate::{MouseButton, MouseButtonAction};
use crate::{FocusId, MouseButton, MouseButtonAction, TraversalId};
#[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)]
pub struct WebDriverMessageId(pub usize);
@ -301,3 +301,13 @@ pub enum WebDriverLoadStatus {
// Navigation is blocked by a user prompt
Blocked,
}
/// A collection of [`IpcSender`]s that are used to asynchronously communicate
/// to a WebDriver server with information about application state.
#[derive(Clone, Default)]
pub struct WebDriverSenders {
pub load_status_senders: HashMap<WebViewId, IpcSender<WebDriverLoadStatus>>,
pub script_evaluation_interrupt_sender: Option<IpcSender<WebDriverJSResult>>,
pub pending_traversals: HashMap<TraversalId, IpcSender<WebDriverLoadStatus>>,
pub pending_focus: HashMap<FocusId, IpcSender<bool>>,
}