From dd9164f49a3f53bd4567687b009da6df9ffd11ed Mon Sep 17 00:00:00 2001 From: webbeef Date: Sun, 5 Jan 2025 13:16:11 -0800 Subject: [PATCH] Update webdriver to 0.51 (#34838) Signed-off-by: webbeef --- Cargo.lock | 21 +++++++++++---------- Cargo.toml | 2 +- components/webdriver_server/lib.rs | 15 +++++---------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 260e06bbbd4..5a35934a5c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -957,7 +957,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1862,7 +1862,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2383,7 +2383,7 @@ dependencies = [ "gobject-sys", "libc", "system-deps", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4048,7 +4048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -5888,7 +5888,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7153,7 +7153,7 @@ dependencies = [ "getrandom", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -8158,22 +8158,23 @@ dependencies = [ [[package]] name = "webdriver" -version = "0.49.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc8773336cf1ad6ffadae7d73fea436e5c4d6345a467292902876cb0f7b72107" +checksum = "310ce9d3648c5ff1915ca7dd09c44eabb7eb17f9ff4a6e7e5f4a902c8d1e269f" dependencies = [ "base64 0.21.7", "bytes", "cookie 0.16.2", "http", + "icu_segmenter", "log", "serde", "serde_derive", "serde_json", + "thiserror 1.0.69", "time 0.3.36", "tokio", "tokio-stream", - "unicode-segmentation", "url", "warp", ] @@ -8444,7 +8445,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 707b194db8b..3b1e262ef33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,7 +148,7 @@ unicode-script = "0.5" unicode-segmentation = "1.12.0" url = "2.5" uuid = { version = "1.11.0", features = ["v4"] } -webdriver = "0.49.0" +webdriver = "0.51.0" webpki-roots = "0.25" webrender = { git = "https://github.com/servo/webrender", branch = "0.65", features = ["capture"] } webrender_api = { git = "https://github.com/servo/webrender", branch = "0.65" } diff --git a/components/webdriver_server/lib.rs b/components/webdriver_server/lib.rs index 0536b320e2d..05746ac4423 100644 --- a/components/webdriver_server/lib.rs +++ b/components/webdriver_server/lib.rs @@ -50,7 +50,7 @@ use webdriver::actions::{ ActionSequence, PointerDownAction, PointerMoveAction, PointerOrigin, PointerType, PointerUpAction, }; -use webdriver::capabilities::{Capabilities, CapabilitiesMatching}; +use webdriver::capabilities::CapabilitiesMatching; use webdriver::command::{ ActionsParameters, AddCookieParameters, GetParameters, JavascriptCommandParameters, LocatorParameters, NewSessionParameters, NewWindowParameters, SendKeysParameters, @@ -477,12 +477,7 @@ impl Handler { parameters: &NewSessionParameters, ) -> WebDriverResult { let mut servo_capabilities = ServoCapabilities::new(); - let processed_capabilities = match parameters { - NewSessionParameters::Legacy(_) => Some(Capabilities::new()), - NewSessionParameters::Spec(capabilities) => { - capabilities.match_browser(&mut servo_capabilities)? - }, - }; + let processed_capabilities = parameters.match_browser(&mut servo_capabilities)?; if self.session.is_none() { match processed_capabilities { @@ -979,14 +974,14 @@ impl Handler { ) -> WebDriverResult { use webdriver::common::FrameId; let frame_id = match parameters.id { - None => { + FrameId::Top => { let session = self.session_mut()?; session.browsing_context_id = BrowsingContextId::from(session.top_level_browsing_context_id); return Ok(WebDriverResponse::Void); }, - Some(FrameId::Short(ref x)) => WebDriverFrameId::Short(*x), - Some(FrameId::Element(ref x)) => WebDriverFrameId::Element(x.to_string()), + FrameId::Short(ref x) => WebDriverFrameId::Short(*x), + FrameId::Element(ref x) => WebDriverFrameId::Element(x.to_string()), }; self.switch_to_frame(frame_id)