| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #include "ash/wm/ash_native_cursor_manager.h" | 4 #include "ash/wm/ash_native_cursor_manager.h" |
| 5 | 5 |
| 6 #include "ash/display/display_info.h" | 6 #include "ash/display/display_info.h" |
| 7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/test/cursor_manager_test_api.h" | 10 #include "ash/test/cursor_manager_test_api.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
| 14 #include "ui/base/test/ui_controls.h" | 14 #include "ui/base/test/ui_controls.h" |
| 15 #include "ui/gl/gl_surface.h" |
| 15 | 16 |
| 16 #if defined(USE_X11) | 17 #if defined(USE_X11) |
| 17 #include <X11/Xlib.h> | 18 #include <X11/Xlib.h> |
| 18 | 19 |
| 19 #include "base/message_loop/message_pump_x11.h" | 20 #include "base/message_loop/message_pump_x11.h" |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 namespace ash { | 23 namespace ash { |
| 23 | 24 |
| 24 using views::corewm::CursorManager; | 25 using views::corewm::CursorManager; |
| 25 typedef test::AshTestBase AshNativeCursorManagerTest; | 26 |
| 27 class AshNativeCursorManagerTest : public test::AshTestBase { |
| 28 public: |
| 29 AshNativeCursorManagerTest() {} |
| 30 virtual ~AshNativeCursorManagerTest() {} |
| 31 |
| 32 virtual void SetUp() OVERRIDE { |
| 33 gfx::GLSurface::InitializeOneOffForTests(); |
| 34 test::AshTestBase::SetUp(); |
| 35 } |
| 36 }; |
| 26 | 37 |
| 27 namespace { | 38 namespace { |
| 28 | 39 |
| 29 internal::DisplayInfo CreateDisplayInfo(int64 id, | 40 internal::DisplayInfo CreateDisplayInfo(int64 id, |
| 30 const gfx::Rect& bounds, | 41 const gfx::Rect& bounds, |
| 31 float device_scale_factor) { | 42 float device_scale_factor) { |
| 32 internal::DisplayInfo info(id, "", false); | 43 internal::DisplayInfo info(id, "", false); |
| 33 info.SetBounds(bounds); | 44 info.SetBounds(bounds); |
| 34 info.set_device_scale_factor(device_scale_factor); | 45 info.set_device_scale_factor(device_scale_factor); |
| 35 return info; | 46 return info; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 display_manager->OnNativeDisplaysChanged(display_info_list); | 92 display_manager->OnNativeDisplaysChanged(display_info_list); |
| 82 | 93 |
| 83 MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10); | 94 MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10); |
| 84 EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); | 95 EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); |
| 85 | 96 |
| 86 MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10); | 97 MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10); |
| 87 EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor()); | 98 EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor()); |
| 88 } | 99 } |
| 89 | 100 |
| 90 } // namespace ash | 101 } // namespace ash |
| OLD | NEW |