| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | 4 |
| 5 #include "ash/display/mirror_window_controller.h" | 5 #include "ash/display/mirror_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Entering mirror mode should have centered the cursor on the primary display | 234 // Entering mirror mode should have centered the cursor on the primary display |
| 235 // because the cursor's previous position is out of bounds. | 235 // because the cursor's previous position is out of bounds. |
| 236 // Check real cursor's position and properties. | 236 // Check real cursor's position and properties. |
| 237 EXPECT_EQ("100,100", env->last_mouse_location().ToString()); | 237 EXPECT_EQ("100,100", env->last_mouse_location().ToString()); |
| 238 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); | 238 EXPECT_EQ(2.0f, cursor_test_api.GetCurrentCursor().device_scale_factor()); |
| 239 EXPECT_EQ(display::Display::ROTATE_90, | 239 EXPECT_EQ(display::Display::ROTATE_90, |
| 240 cursor_test_api.GetCurrentCursorRotation()); | 240 cursor_test_api.GetCurrentCursorRotation()); |
| 241 | 241 |
| 242 // Check mirrored cursor's location. | 242 // Check mirrored cursor's location. |
| 243 test::MirrorWindowTestApi test_api; | 243 test::MirrorWindowTestApi test_api; |
| 244 // The hot point location depends on the specific cursor. |
| 245 EXPECT_EQ(ui::kCursorNull, test_api.GetCurrentCursorType()); |
| 244 // Rotated hot point must be (25-7, 7). | 246 // Rotated hot point must be (25-7, 7). |
| 245 EXPECT_EQ("18,7", test_api.GetCursorHotPoint().ToString()); | 247 EXPECT_EQ("18,7", test_api.GetCursorHotPoint().ToString()); |
| 246 // New coordinates are not (200,200) because (200,200) is not the center of | 248 // New coordinates are not (200,200) because (200,200) is not the center of |
| 247 // the display. | 249 // the display. |
| 248 EXPECT_EQ("199,200", | 250 EXPECT_EQ("199,200", |
| 249 test_api.GetCursorHotPointLocationInRootWindow().ToString()); | 251 test_api.GetCursorHotPointLocationInRootWindow().ToString()); |
| 250 } | 252 } |
| 251 | 253 |
| 252 // Make sure that the compositor based mirroring can switch | 254 // Make sure that the compositor based mirroring can switch |
| 253 // from/to dock mode. | 255 // from/to dock mode. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 298 } |
| 297 | 299 |
| 298 TEST_F(MirrorOnBootTest, MAYBE_MirrorOnBoot) { | 300 TEST_F(MirrorOnBootTest, MAYBE_MirrorOnBoot) { |
| 299 EXPECT_TRUE(display_manager()->IsInMirrorMode()); | 301 EXPECT_TRUE(display_manager()->IsInMirrorMode()); |
| 300 RunAllPendingInMessageLoop(); | 302 RunAllPendingInMessageLoop(); |
| 301 test::MirrorWindowTestApi test_api; | 303 test::MirrorWindowTestApi test_api; |
| 302 EXPECT_TRUE(test_api.GetHost()); | 304 EXPECT_TRUE(test_api.GetHost()); |
| 303 } | 305 } |
| 304 | 306 |
| 305 } // namespace ash | 307 } // namespace ash |
| OLD | NEW |