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

Unified Diff: components/mus/public/cpp/tests/window_tree_client_impl_private.cc

Issue 1994223003: views/mus: Add a test to verify that Widget receives events correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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
Index: components/mus/public/cpp/tests/window_tree_client_impl_private.cc
diff --git a/components/mus/public/cpp/tests/window_tree_client_impl_private.cc b/components/mus/public/cpp/tests/window_tree_client_impl_private.cc
index 795e3dc0d2020322c46105298d64e2af29c53425..28f6b0ff101afe87268f8698efd8ba77792f890f 100644
--- a/components/mus/public/cpp/tests/window_tree_client_impl_private.cc
+++ b/components/mus/public/cpp/tests/window_tree_client_impl_private.cc
@@ -5,7 +5,9 @@
#include "components/mus/public/cpp/tests/window_tree_client_impl_private.h"
#include "components/mus/public/cpp/lib/window_tree_client_impl.h"
+#include "components/mus/public/cpp/window.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/input_events/input_events_type_converters.h"
namespace mus {
@@ -13,6 +15,9 @@ WindowTreeClientImplPrivate::WindowTreeClientImplPrivate(
WindowTreeClientImpl* tree_client_impl)
: tree_client_impl_(tree_client_impl) {}
+WindowTreeClientImplPrivate::WindowTreeClientImplPrivate(Window* window)
+ : WindowTreeClientImplPrivate(window->tree_client()) {}
+
WindowTreeClientImplPrivate::~WindowTreeClientImplPrivate() {}
uint32_t WindowTreeClientImplPrivate::event_observer_id() {
@@ -33,4 +38,13 @@ void WindowTreeClientImplPrivate::OnEmbed(mojom::WindowTree* window_tree) {
tree_client_impl_->OnEmbedImpl(window_tree, 1, std::move(root_data), 0, true);
}
+void WindowTreeClientImplPrivate::CallOnWindowInputEvent(
+ Window* window,
+ const ui::Event& event) {
+ const uint32_t event_id = 0u;
+ const uint32_t observer_id = 0u;
+ tree_client_impl_->OnWindowInputEvent(event_id, window->server_id(),
+ mojom::Event::From(event), observer_id);
+}
+
} // namespace mus
« no previous file with comments | « components/mus/public/cpp/tests/window_tree_client_impl_private.h ('k') | components/mus/public/cpp/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698