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

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

Issue 1775133003: Moves EventDispatcher from Display to WindowManagerState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo Created 4 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 | « components/mus/ws/event_dispatcher_unittest.cc ('k') | components/mus/ws/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/test_utils.h
diff --git a/components/mus/ws/test_utils.h b/components/mus/ws/test_utils.h
index 642fd1b78e84866a651a59bd101aca9c34e276d1..d431e244eb4c7f5c83f1a42d6676447c1d844975 100644
--- a/components/mus/ws/test_utils.h
+++ b/components/mus/ws/test_utils.h
@@ -11,11 +11,13 @@
#include "components/mus/public/interfaces/window_tree.mojom.h"
#include "components/mus/ws/connection_manager_delegate.h"
#include "components/mus/ws/display.h"
+#include "components/mus/ws/event_dispatcher.h"
#include "components/mus/ws/platform_display.h"
#include "components/mus/ws/platform_display_factory.h"
#include "components/mus/ws/test_change_tracker.h"
#include "components/mus/ws/user_display_manager.h"
#include "components/mus/ws/window_manager_factory_registry.h"
+#include "components/mus/ws/window_manager_state.h"
#include "components/mus/ws/window_tree.h"
#include "components/mus/ws/window_tree_binding.h"
@@ -68,6 +70,8 @@ class WindowTreeTestApi {
tree_->window_manager_internal_ = wm_internal;
}
+ void EnableCapture() { tree_->event_ack_id_ = 1u; }
+
private:
WindowTree* tree_;
@@ -83,14 +87,47 @@ class DisplayTestApi {
void OnEvent(const ui::Event& event) { display_->OnEvent(event); }
+ private:
+ Display* display_;
+
+ DISALLOW_COPY_AND_ASSIGN(DisplayTestApi);
+};
+
+// -----------------------------------------------------------------------------
+
+class EventDispatcherTestApi {
+ public:
+ explicit EventDispatcherTestApi(EventDispatcher* ed) : ed_(ed) {}
+ ~EventDispatcherTestApi() {}
+
+ bool AreAnyPointersDown() const { return ed_->AreAnyPointersDown(); }
+ bool is_mouse_button_down() const { return ed_->mouse_button_down_; }
+ bool IsObservingWindow(ServerWindow* window) {
+ return ed_->IsObservingWindow(window);
+ }
+ int NumberPointerTargetsForWindow(ServerWindow* window);
+
+ private:
+ EventDispatcher* ed_;
+
+ DISALLOW_COPY_AND_ASSIGN(EventDispatcherTestApi);
+};
+
+// -----------------------------------------------------------------------------
+
+class WindowManagerStateTestApi {
+ public:
+ explicit WindowManagerStateTestApi(WindowManagerState* wms) : wms_(wms) {}
+ ~WindowManagerStateTestApi() {}
+
mojom::WindowTree* tree_awaiting_input_ack() {
- return display_->tree_awaiting_input_ack_;
+ return wms_->tree_awaiting_input_ack_;
}
private:
- Display* display_;
+ WindowManagerState* wms_;
- DISALLOW_COPY_AND_ASSIGN(DisplayTestApi);
+ DISALLOW_COPY_AND_ASSIGN(WindowManagerStateTestApi);
};
// -----------------------------------------------------------------------------
« no previous file with comments | « components/mus/ws/event_dispatcher_unittest.cc ('k') | components/mus/ws/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698