webdriver: Properly insert the user agent into the capabilities data structure (#37876)

Add user agent into webdriver capabilities.

Testing:
`/mach test-wpt -r --product servodriver
./tests/wpt/tests/webdriver/tests/classic/new_session/response.py`

Signed-off-by: batu_hoang <longvatrong111@gmail.com>
This commit is contained in:
batu_hoang 2025-07-05 02:09:59 +08:00 committed by GitHub
parent 4ee7a34f32
commit 8df5e1e74d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -678,6 +678,10 @@ impl Handler {
"setWindowRect".to_string(),
json!(servo_capabilities.set_window_rect),
);
processed.insert(
"userAgent".to_string(),
servo_config::pref!(user_agent).into(),
);
let response =
NewSessionResponse::new(session.id.to_string(), Value::Object(processed));

View file

@ -1,3 +0,0 @@
[response.py]
[test_capability_user_agent]
expected: FAIL