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 |