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..7e0f382187dda6b093a53f8148bb158e0d294f76 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,26 @@ 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; |
+ } |
+ |
+ static_cast<PlatformDisplayDelegate*>(display)->OnEvent(*event.get()); |
+ cb.Run(true); |
+} |
+ |
} // namespace ws |
} // namespace ui |