| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 | 4 |
| 5 #include "ash/display/cursor_window_controller.h" | 5 #include "ash/display/cursor_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_util.h" | 7 #include "ash/display/display_util.h" |
| 8 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 private: | 58 private: |
| 59 // Not owned. | 59 // Not owned. |
| 60 CursorWindowController* cursor_window_controller_; | 60 CursorWindowController* cursor_window_controller_; |
| 61 | 61 |
| 62 DISALLOW_COPY_AND_ASSIGN(CursorWindowControllerTest); | 62 DISALLOW_COPY_AND_ASSIGN(CursorWindowControllerTest); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // Test that the composited cursor moves to another display when the real cursor | 65 // Test that the composited cursor moves to another display when the real cursor |
| 66 // moves to another display. | 66 // moves to another display. |
| 67 TEST_F(CursorWindowControllerTest, MoveToDifferentDisplay) { | 67 TEST_F(CursorWindowControllerTest, MoveToDifferentDisplay) { |
| 68 if (!SupportsMultipleDisplays()) | |
| 69 return; | |
| 70 | |
| 71 UpdateDisplay("200x200,200x200*2/r"); | 68 UpdateDisplay("200x200,200x200*2/r"); |
| 72 | 69 |
| 73 WindowTreeHostManager* window_tree_host_manager = | 70 WindowTreeHostManager* window_tree_host_manager = |
| 74 Shell::GetInstance()->window_tree_host_manager(); | 71 Shell::GetInstance()->window_tree_host_manager(); |
| 75 int64_t primary_display_id = window_tree_host_manager->GetPrimaryDisplayId(); | 72 int64_t primary_display_id = window_tree_host_manager->GetPrimaryDisplayId(); |
| 76 int64_t secondary_display_id = display_manager()->GetSecondaryDisplay().id(); | 73 int64_t secondary_display_id = display_manager()->GetSecondaryDisplay().id(); |
| 77 aura::Window* primary_root = | 74 aura::Window* primary_root = |
| 78 window_tree_host_manager->GetRootWindowForDisplayId(primary_display_id); | 75 window_tree_host_manager->GetRootWindowForDisplayId(primary_display_id); |
| 79 aura::Window* secondary_root = | 76 aura::Window* secondary_root = |
| 80 window_tree_host_manager->GetRootWindowForDisplayId(secondary_display_id); | 77 window_tree_host_manager->GetRootWindowForDisplayId(secondary_display_id); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 ASSERT_TRUE(display::test::DisplayManagerTestApi(display_manager()) | 164 ASSERT_TRUE(display::test::DisplayManagerTestApi(display_manager()) |
| 168 .SetDisplayUIScale(primary_id, 2.0f)); | 165 .SetDisplayUIScale(primary_id, 2.0f)); |
| 169 ASSERT_EQ( | 166 ASSERT_EQ( |
| 170 1.0f, | 167 1.0f, |
| 171 display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor()); | 168 display::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor()); |
| 172 EXPECT_TRUE(GetCursorImage().HasRepresentation(2.0f)); | 169 EXPECT_TRUE(GetCursorImage().HasRepresentation(2.0f)); |
| 173 } | 170 } |
| 174 #endif | 171 #endif |
| 175 | 172 |
| 176 } // namespace ash | 173 } // namespace ash |
| OLD | NEW |