Chromium Code Reviews| Index: services/ui/ws/window_server_test_impl.cc |
| diff --git a/services/ui/ws/window_server_test_impl.cc b/services/ui/ws/window_server_test_impl.cc |
| index 20bc295c323a9dc0c30776295bcc7b0f25cad68d..2fb397bb7caf9f20afc1e982aa09bf1b07bffa7f 100644 |
| --- a/services/ui/ws/window_server_test_impl.cc |
| +++ b/services/ui/ws/window_server_test_impl.cc |
| @@ -5,6 +5,8 @@ |
| #include "services/ui/ws/window_server_test_impl.h" |
| #include "services/ui/public/interfaces/window_tree.mojom.h" |
| +#include "services/ui/ws/display.h" |
| +#include "services/ui/ws/display_manager.h" |
| #include "services/ui/ws/server_window.h" |
| #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" |
| #include "services/ui/ws/window_server.h" |
| @@ -49,5 +51,32 @@ void WindowServerTestImpl::EnsureClientHasDrawnWindow( |
| client_name, std::move(callback))); |
| } |
| +void WindowServerTestImpl::DispatchEvent(int64_t display_id, |
| + std::unique_ptr<ui::Event> event, |
| + const DispatchEventCallback& cb) { |
| + DisplayManager* manager = window_server_->display_manager(); |
| + if (!manager) { |
| + DVLOG(1) << "No display manager in DispatchEvent."; |
| + cb.Run(false); |
| + return; |
| + } |
| + |
| + Display* display = manager->GetDisplayById(display_id); |
| + if (!display) { |
| + DVLOG(1) << "Invalid display_id in DispatchEvent."; |
| + cb.Run(false); |
| + return; |
| + } |
| + |
| + if (!event) { |
|
sky
2017/03/17 00:02:21
Correct me if I'm wrong, but because the mojom doe
Elliot Glaysher
2017/03/17 17:43:11
Done.
|
| + DVLOG(1) << "Passed null event in DispatchEvent."; |
| + cb.Run(false); |
| + return; |
| + } |
| + |
| + static_cast<PlatformDisplayDelegate*>(display)->OnEvent(*event.get()); |
| + cb.Run(true); |
| +} |
| + |
| } // namespace ws |
| } // namespace ui |