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

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: . 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 d1563da167dcf0f6935e49f6db02d018550994da..734f55f881515d1226a01b8ca2021d83fdf134df 100644
--- a/components/mus/ws/test_utils.cc
+++ b/components/mus/ws/test_utils.cc
@@ -109,6 +109,14 @@ PlatformDisplay* TestPlatformDisplayFactory::CreatePlatformDisplay() {
WindowTreeTestApi::WindowTreeTestApi(WindowTree* tree) : tree_(tree) {}
WindowTreeTestApi::~WindowTreeTestApi() {}
+void WindowTreeTestApi::SetEventObserver(mojom::EventMatcherPtr matcher) {
+ tree_->SetEventObserver(std::move(matcher));
+}
+
+void WindowTreeTestApi::ClearEventObserver() {
+ tree_->ClearEventObserver();
+}
+
// DisplayTestApi ------------------------------------------------------------
DisplayTestApi::DisplayTestApi(Display* display) : display_(display) {}
@@ -259,6 +267,10 @@ void TestWindowTreeClient::OnWindowInputEvent(uint32_t event_id,
tracker_.OnWindowInputEvent(window, std::move(event));
}
+void TestWindowTreeClient::OnEventObserved(mojom::EventPtr event) {
+ tracker_.OnEventObserved(std::move(event));
+}
+
void TestWindowTreeClient::OnWindowFocused(uint32_t focused_window_id) {
tracker_.OnWindowFocused(focused_window_id);
}

Powered by Google App Engine
This is Rietveld 408576698