Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: services/ui/ws/window_server_test_impl.cc

Issue 2759463002: aura-mus: create an interactive ui test for drag and drop. (Closed)
Patch Set: Merge with master Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/ws/window_server_test_impl.h ('k') | services/ui/ws/window_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « services/ui/ws/window_server_test_impl.h ('k') | services/ui/ws/window_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698