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

Unified Diff: chrome/test/base/view_event_test_platform_part_default.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/view_event_test_platform_part_default.cc
diff --git a/chrome/test/base/view_event_test_platform_part_default.cc b/chrome/test/base/view_event_test_platform_part_default.cc
index 75050091c611d6c62a1c5e23890d07dfd50c670e..54497609886cb9e5b8ace1f4faaf0251b9bbc3f4 100644
--- a/chrome/test/base/view_event_test_platform_part_default.cc
+++ b/chrome/test/base/view_event_test_platform_part_default.cc
@@ -10,6 +10,10 @@
#include "ui/display/screen.h"
#include "ui/views/widget/desktop_aura/desktop_screen.h"
+#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
+#include "ui/views/test/test_desktop_screen_x11.h"
+#endif
+
namespace {
// ViewEventTestPlatformPart implementation for Views, but non-CrOS.
@@ -18,8 +22,14 @@ class ViewEventTestPlatformPartDefault : public ViewEventTestPlatformPart {
explicit ViewEventTestPlatformPartDefault(
ui::ContextFactory* context_factory) {
#if defined(USE_AURA)
+ DCHECK(!display::Screen::GetScreen());
+#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
+ display::Screen::SetScreenInstance(
+ views::test::TestDesktopScreenX11::GetInstance());
+#else
screen_.reset(views::CreateDesktopScreen());
display::Screen::SetScreenInstance(screen_.get());
+#endif
env_ = aura::Env::CreateInstance();
env_->set_context_factory(context_factory);
#endif
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698