mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Chore: Merge all moved webdriver command msg in constellation (#38081)
Small clean up to shortened the code length and making it more neat. Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
This commit is contained in:
parent
f155c95e1b
commit
ccc902eb7a
1 changed files with 16 additions and 42 deletions
|
@ -4552,37 +4552,10 @@ where
|
||||||
// Find the script channel for the given parent pipeline,
|
// Find the script channel for the given parent pipeline,
|
||||||
// and pass the event to that script thread.
|
// and pass the event to that script thread.
|
||||||
match msg {
|
match msg {
|
||||||
WebDriverCommandMsg::CloseWebView(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::NewWebView(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::FocusWebView(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::IsWebViewOpen(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::IsBrowsingContextOpen(browsing_context_id, response_sender) => {
|
WebDriverCommandMsg::IsBrowsingContextOpen(browsing_context_id, response_sender) => {
|
||||||
let is_open = self.browsing_contexts.contains_key(&browsing_context_id);
|
let is_open = self.browsing_contexts.contains_key(&browsing_context_id);
|
||||||
let _ = response_sender.send(is_open);
|
let _ = response_sender.send(is_open);
|
||||||
},
|
},
|
||||||
WebDriverCommandMsg::GetWindowRect(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::GetViewportSize(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::SetWindowSize(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::LoadUrl(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::Refresh(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
// TODO: This should use the ScriptThreadMessage::EvaluateJavaScript command
|
// TODO: This should use the ScriptThreadMessage::EvaluateJavaScript command
|
||||||
WebDriverCommandMsg::ScriptCommand(browsing_context_id, cmd) => {
|
WebDriverCommandMsg::ScriptCommand(browsing_context_id, cmd) => {
|
||||||
let pipeline_id = self
|
let pipeline_id = self
|
||||||
|
@ -4599,21 +4572,6 @@ where
|
||||||
self.handle_send_error(pipeline_id, e);
|
self.handle_send_error(pipeline_id, e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
WebDriverCommandMsg::SendKeys(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::KeyboardAction(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::MouseButtonAction(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::MouseMoveAction(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::WheelScrollAction(..) => {
|
|
||||||
unreachable!("This command should be send directly to the embedder.");
|
|
||||||
},
|
|
||||||
WebDriverCommandMsg::TakeScreenshot(webview_id, rect, response_sender) => {
|
WebDriverCommandMsg::TakeScreenshot(webview_id, rect, response_sender) => {
|
||||||
self.compositor_proxy.send(CompositorMsg::CreatePng(
|
self.compositor_proxy.send(CompositorMsg::CreatePng(
|
||||||
webview_id,
|
webview_id,
|
||||||
|
@ -4621,6 +4579,22 @@ where
|
||||||
response_sender,
|
response_sender,
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
|
WebDriverCommandMsg::CloseWebView(..) |
|
||||||
|
WebDriverCommandMsg::NewWebView(..) |
|
||||||
|
WebDriverCommandMsg::FocusWebView(..) |
|
||||||
|
WebDriverCommandMsg::IsWebViewOpen(..) |
|
||||||
|
WebDriverCommandMsg::GetWindowRect(..) |
|
||||||
|
WebDriverCommandMsg::GetViewportSize(..) |
|
||||||
|
WebDriverCommandMsg::SetWindowSize(..) |
|
||||||
|
WebDriverCommandMsg::LoadUrl(..) |
|
||||||
|
WebDriverCommandMsg::Refresh(..) |
|
||||||
|
WebDriverCommandMsg::SendKeys(..) |
|
||||||
|
WebDriverCommandMsg::KeyboardAction(..) |
|
||||||
|
WebDriverCommandMsg::MouseButtonAction(..) |
|
||||||
|
WebDriverCommandMsg::MouseMoveAction(..) |
|
||||||
|
WebDriverCommandMsg::WheelScrollAction(..) => {
|
||||||
|
unreachable!("This command should be send directly to the embedder.");
|
||||||
|
},
|
||||||
_ => {
|
_ => {
|
||||||
warn!("Unhandled WebDriver command: {:?}", msg);
|
warn!("Unhandled WebDriver command: {:?}", msg);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue