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

Unified Diff: ui/views/widget/desktop_aura/desktop_screen_x11.cc

Issue 2327623002: X11: Add TestDesktopScreenX11 to simulate mouse movement in ui tests (Closed)
Patch Set: Created 4 years, 3 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: ui/views/widget/desktop_aura/desktop_screen_x11.cc
diff --git a/ui/views/widget/desktop_aura/desktop_screen_x11.cc b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
index d3d2315bce9cb981ed62c4ab33d61c80d3616150..f0ada13946acc1e2cd324d45ae8c9e807c97fc6a 100644
--- a/ui/views/widget/desktop_aura/desktop_screen_x11.cc
+++ b/ui/views/widget/desktop_aura/desktop_screen_x11.cc
@@ -405,9 +405,31 @@ void DesktopScreenX11::SetDisplaysInternal(
}
////////////////////////////////////////////////////////////////////////////////
+// TestDesktopScreenX11, public:
+
+TestDesktopScreenX11::TestDesktopScreenX11() {}
+
+TestDesktopScreenX11::~TestDesktopScreenX11() {}
+
+gfx::Point TestDesktopScreenX11::GetCursorScreenPoint() {
+ return cursor_screen_point_;
+}
+
+void TestDesktopScreenX11::SetCursorScreenPoint(const gfx::Point& point) {
+ cursor_screen_point_ = point;
+}
+
+////////////////////////////////////////////////////////////////////////////////
display::Screen* CreateDesktopScreen() {
return new DesktopScreenX11;
}
+TestDesktopScreenX11* GetTestDesktopScreenX11() {
+ static std::unique_ptr<TestDesktopScreenX11> test_screen_instance;
+ if (!test_screen_instance.get())
+ test_screen_instance.reset(new TestDesktopScreenX11());
+ return test_screen_instance.get();
+}
+
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698