Initial actions support in WebDriver

This commit is contained in:
George Roman 2019-07-12 22:00:46 +03:00
parent 79b456d84e
commit 75efb09147
6 changed files with 291 additions and 6 deletions

View file

@ -3468,6 +3468,28 @@ where
}
}
},
WebDriverCommandMsg::KeyboardAction(browsing_context_id, event) => {
let pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
Some(browsing_context) => browsing_context.pipeline_id,
None => {
return warn!(
"Browsing context {} KeyboardAction after closure.",
browsing_context_id
);
},
};
let event_loop = match self.pipelines.get(&pipeline_id) {
Some(pipeline) => pipeline.event_loop.clone(),
None => return warn!("Pipeline {} KeyboardAction after closure.", pipeline_id),
};
let control_msg = ConstellationControlMsg::SendEvent(
pipeline_id,
CompositorEvent::KeyboardEvent(event),
);
if let Err(e) = event_loop.send(control_msg) {
return self.handle_send_error(pipeline_id, e);
}
},
WebDriverCommandMsg::TakeScreenshot(_, reply) => {
self.compositor_proxy
.send(ToCompositorMsg::CreatePng(reply));