webdriver: Assume more consistently that the BrowsingContext exists (#37389)

1. Tidy up some WebDriver handling with browsing context
2. Enable more wpt-test which no longer panic

Testing: `./mach test-wpt -r --log-raw "D:\servo test log\all.txt"
.\tests\wpt\tests\webdriver\tests\classic\ --product servodriver`

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-06-11 22:23:47 +08:00 committed by GitHub
parent fab958258e
commit c1ee354c38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 28 additions and 108 deletions

View file

@ -11,6 +11,7 @@ use constellation_traits::EmbedderToConstellationMessage;
use embedder_traits::{MouseButtonAction, WebDriverCommandMsg, WebDriverScriptCommand};
use ipc_channel::ipc;
use keyboard_types::webdriver::KeyInputState;
use log::{error, info};
use webdriver::actions::{
ActionSequence, ActionsType, GeneralAction, KeyAction, KeyActionItem, KeyDownAction,
KeyUpAction, NullActionItem, PointerAction, PointerActionItem, PointerDownAction,
@ -158,7 +159,7 @@ impl Handler {
}
// Step 2. Return success with data null.
dbg!("Dispatch actions completed successfully");
info!("Dispatch actions completed successfully");
Ok(())
}
@ -193,12 +194,12 @@ impl Handler {
.expect("Current id should be set before dispatch_actions_inner is called");
if current_waiting_id != response.id {
dbg!("Dispatch actions completed with wrong id in response");
error!("Dispatch actions completed with wrong id in response");
return Err(ErrorStatus::UnknownError);
}
},
Err(error) => {
dbg!("Dispatch actions completed with IPC error: {:?}", error);
error!("Dispatch actions completed with IPC error: {error}");
return Err(ErrorStatus::UnknownError);
},
};