| Index: ash/display/mouse_cursor_event_filter_unittest.cc
|
| diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc
|
| index 2c050bae1bfd644abb48bcad511148705eb774ce..1beb369e4cdc2470504fb212d7a5168d6c9f0eaf 100644
|
| --- a/ash/display/mouse_cursor_event_filter_unittest.cc
|
| +++ b/ash/display/mouse_cursor_event_filter_unittest.cc
|
| @@ -6,7 +6,9 @@
|
|
|
| #include "ash/shell.h"
|
| #include "ash/test/ash_test_base.h"
|
| +#include "ash/test/cursor_manager_test_api.h"
|
| #include "ash/display/display_controller.h"
|
| +#include "ash/wm/cursor_manager.h"
|
| #include "ui/aura/env.h"
|
| #include "ui/aura/root_window.h"
|
| #include "ui/gfx/display.h"
|
| @@ -272,5 +274,30 @@ TEST_F(MouseCursorEventFilterTest, IndicatorBoundsTestOnTopBottom) {
|
| event_filter->HideSharedEdgeIndicator();
|
| }
|
|
|
| +// Verifies cursor's device scale factor is updated when a cursor has moved
|
| +// across root windows with different device scale factors
|
| +// (http://crbug.com/154183).
|
| +TEST_F(MouseCursorEventFilterTest, CursorDeviceScaleFactor) {
|
| + UpdateDisplay("400x400,800x800*2");
|
| + DisplayController* controller =
|
| + Shell::GetInstance()->display_controller();
|
| + DisplayLayout default_layout(DisplayLayout::RIGHT, 0);
|
| + controller->SetDefaultDisplayLayout(default_layout);
|
| + Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
|
| + ASSERT_EQ(2U, root_windows.size());
|
| + test::CursorManagerTestApi cursor_test_api(
|
| + Shell::GetInstance()->cursor_manager());
|
| + MouseCursorEventFilter* event_filter =
|
| + Shell::GetInstance()->mouse_cursor_filter();
|
| +
|
| + EXPECT_EQ(1.0f, cursor_test_api.GetDeviceScaleFactor());
|
| + event_filter->WarpMouseCursorIfNecessary(root_windows[0],
|
| + gfx::Point(399, 200));
|
| + EXPECT_EQ(2.0f, cursor_test_api.GetDeviceScaleFactor());
|
| + event_filter->WarpMouseCursorIfNecessary(root_windows[1],
|
| + gfx::Point(400, 200));
|
| + EXPECT_EQ(1.0f, cursor_test_api.GetDeviceScaleFactor());
|
| +}
|
| +
|
| } // namespace internal
|
| } // namespace ash
|
|
|