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

Side by Side Diff: ui/views/test/test_desktop_screen_x11.h

Issue 2327623002: X11: Add TestDesktopScreenX11 to simulate mouse movement in ui tests (Closed)
Patch Set: Move test_desktop_screen_x11 to test_support_internal 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 unified diff | Download patch
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/test/test_desktop_screen_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_TEST_TEST_DESKTOP_SCREEN_X11_H_
6 #define UI_VIEWS_TEST_TEST_DESKTOP_SCREEN_X11_H_
7
8 #include "ui/gfx/geometry/point.h"
9 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h"
10
11 namespace base {
12 template<typename T> struct DefaultSingletonTraits;
13 }
14
15 namespace views {
16 namespace test {
17
18 // Replaces the screen instance in Linux (non-ChromeOS) tests. Allows
19 // aura tests to manually set the cursor screen point to be reported
20 // by GetCursorScreenPoint(). Needed because of a limitation in the
21 // X11 protocol that restricts us from warping the pointer with the
22 // mouse button held down.
23 class TestDesktopScreenX11 : public DesktopScreenX11 {
24 public:
25 static TestDesktopScreenX11* GetInstance();
26
27 TestDesktopScreenX11();
28 ~TestDesktopScreenX11() override;
29
30 // DesktopScreenX11:
31 gfx::Point GetCursorScreenPoint() override;
32
33 void set_cursor_screen_point(const gfx::Point& point) {
34 cursor_screen_point_ = point;
35 }
36
37 private:
38 friend struct base::DefaultSingletonTraits<TestDesktopScreenX11>;
39
40 gfx::Point cursor_screen_point_;
41
42 DISALLOW_COPY_AND_ASSIGN(TestDesktopScreenX11);
43 };
44
45 } // namespace test
46 } // namespace views
47
48 #endif // UI_VIEWS_TEST_TEST_DESKTOP_SCREEN_X11_H_
OLDNEW
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/test/test_desktop_screen_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698