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" |
(...skipping 21 matching lines...) Expand all Loading... |
32 internal::DisplayInfo info(id, "", false); | 32 internal::DisplayInfo info(id, "", false); |
33 info.SetBounds(bounds); | 33 info.SetBounds(bounds); |
34 info.set_device_scale_factor(device_scale_factor); | 34 info.set_device_scale_factor(device_scale_factor); |
35 return info; | 35 return info; |
36 } | 36 } |
37 | 37 |
38 void MoveMouseSync(aura::Window* window, int x, int y) { | 38 void MoveMouseSync(aura::Window* window, int x, int y) { |
39 #if defined(USE_X11) | 39 #if defined(USE_X11) |
40 XWarpPointer(base::MessagePumpX11::GetDefaultXDisplay(), | 40 XWarpPointer(base::MessagePumpX11::GetDefaultXDisplay(), |
41 None, | 41 None, |
42 window->GetDispatcher()->host()->GetAcceleratedWidget(), | 42 window->GetHost()->GetAcceleratedWidget(), |
43 0, 0, 0, 0, | 43 0, 0, 0, 0, |
44 x, y); | 44 x, y); |
45 #endif | 45 #endif |
46 // Send and wait for a key event to make sure that mouse | 46 // Send and wait for a key event to make sure that mouse |
47 // events are fully processed. | 47 // events are fully processed. |
48 base::RunLoop loop; | 48 base::RunLoop loop; |
49 ui_controls::SendKeyPressNotifyWhenDone( | 49 ui_controls::SendKeyPressNotifyWhenDone( |
50 window, | 50 window, |
51 ui::VKEY_SPACE, | 51 ui::VKEY_SPACE, |
52 false, | 52 false, |
(...skipping 28 matching lines...) Expand all Loading... |
81 display_manager->OnNativeDisplaysChanged(display_info_list); | 81 display_manager->OnNativeDisplaysChanged(display_info_list); |
82 | 82 |
83 MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10); | 83 MoveMouseSync(Shell::GetAllRootWindows()[0], 10, 10); |
84 EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); | 84 EXPECT_EQ(1.0f, test_api.GetDisplay().device_scale_factor()); |
85 | 85 |
86 MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10); | 86 MoveMouseSync(Shell::GetAllRootWindows()[0], 600, 10); |
87 EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor()); | 87 EXPECT_EQ(2.0f, test_api.GetDisplay().device_scale_factor()); |
88 } | 88 } |
89 | 89 |
90 } // namespace ash | 90 } // namespace ash |
OLD | NEW |