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

Unified Diff: components/mus/ws/test_utils.cc

Issue 1909733002: mus: Add EventObserver to allow passively listening to UI events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/ws/test_utils.cc
diff --git a/components/mus/ws/test_utils.cc b/components/mus/ws/test_utils.cc
index 8e54e961bb60069f97736ecb0a7dc666ce460036..43953f0d0d868a465f26929531b218a36c871e26 100644
--- a/components/mus/ws/test_utils.cc
+++ b/components/mus/ws/test_utils.cc
@@ -110,6 +110,11 @@ PlatformDisplay* TestPlatformDisplayFactory::CreatePlatformDisplay() {
WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {}
WindowTreeTestApi::~WindowTreeTestApi() {}
+void WindowTreeTestApi::SetEventObserver(mojom::EventMatcherPtr matcher,
+ uint32_t event_observer_id) {
+ tree_->SetEventObserver(std::move(matcher), event_observer_id);
+}
+
// DisplayTestApi ------------------------------------------------------------
DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {}
@@ -256,8 +261,14 @@ void TestWindowTreeClient::OnWindowSharedPropertyChanged(
void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id,
uint32_t window,
- mojom::EventPtr event) {
- tracker_.OnWindowInputEvent(window, std::move(event));
+ mojom::EventPtr event,
+ uint32_t event_observer_id) {
+ tracker_.OnWindowInputEvent(window, std::move(event), event_observer_id);
+}
+
+void TestWindowTreeClient::OnEventObserved(mojom::EventPtr event,
+ uint32_t event_observer_id) {
+ tracker_.OnEventObserved(std::move(event), event_observer_id);
}
void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) {

Powered by Google App Engine
This is Rietveld 408576698