Webdriver: Call webdriver handler on headless EventLoop (#37623)

Previously, `handle_webdriver_messages` only called in
`winit::ApplictionHandler`. This means the webdriver command only looped
in headed (desktop) event loop.

Testing: this will fix webdriver test on headless `test-wpt`, which
widely used in the CI.

Signed-off-by: PotatoCP <kenzieradityatirtarahardja18@gmail.com>
This commit is contained in:
Kenzie Raditya Tirtarahardja 2025-06-23 15:52:53 +08:00 committed by GitHub
parent 8140f00988
commit 795367c751
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -316,7 +316,7 @@ impl App {
} }
} }
fn handle_webdriver_messages(&mut self) { pub fn handle_webdriver_messages(&self) {
let AppState::Running(running_state) = &self.state else { let AppState::Running(running_state) = &self.state else {
return; return;
}; };

View file

@ -93,6 +93,7 @@ impl EventsLoop {
app.init(None); app.init(None);
loop { loop {
self.sleep(flag, condvar); self.sleep(flag, condvar);
app.handle_webdriver_messages();
if !app.handle_events_with_headless() { if !app.handle_events_with_headless() {
break; break;
} }