| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
| 6 #include "ash/magnifier/partial_magnification_controller.h" | 6 #include "ash/magnifier/partial_magnification_controller.h" |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
| 9 #include "ui/display/manager/display_manager.h" | 9 #include "ui/display/manager/display_manager.h" |
| 10 #include "ui/events/test/event_generator.h" | 10 #include "ui/events/test/event_generator.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 EXPECT_TRUE(GetTestApi().is_active()); | 82 EXPECT_TRUE(GetTestApi().is_active()); |
| 83 EXPECT_TRUE(GetTestApi().host_widget()); | 83 EXPECT_TRUE(GetTestApi().host_widget()); |
| 84 GetEventGenerator().ReleaseTouch(); | 84 GetEventGenerator().ReleaseTouch(); |
| 85 EXPECT_FALSE(GetTestApi().is_active()); | 85 EXPECT_FALSE(GetTestApi().is_active()); |
| 86 EXPECT_FALSE(GetTestApi().host_widget()); | 86 EXPECT_FALSE(GetTestApi().host_widget()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Verifies that nothing bad happens if a second display is disconnected while | 89 // Verifies that nothing bad happens if a second display is disconnected while |
| 90 // the magnifier is active. | 90 // the magnifier is active. |
| 91 TEST_F(PartialMagnificationControllerTest, MultipleDisplays) { | 91 TEST_F(PartialMagnificationControllerTest, MultipleDisplays) { |
| 92 if (!SupportsMultipleDisplays()) | |
| 93 return; | |
| 94 GetEventGenerator().EnterPenPointerMode(); | 92 GetEventGenerator().EnterPenPointerMode(); |
| 95 | 93 |
| 96 // Active magnifier with two displays, move it to the second display. | 94 // Active magnifier with two displays, move it to the second display. |
| 97 UpdateDisplay("800x600,800x600"); | 95 UpdateDisplay("800x600,800x600"); |
| 98 GetController()->SetEnabled(true); | 96 GetController()->SetEnabled(true); |
| 99 GetEventGenerator().PressTouch(); | 97 GetEventGenerator().PressTouch(); |
| 100 GetEventGenerator().MoveTouch(gfx::Point(1200, 300)); | 98 GetEventGenerator().MoveTouch(gfx::Point(1200, 300)); |
| 101 EXPECT_TRUE(GetTestApi().is_active()); | 99 EXPECT_TRUE(GetTestApi().is_active()); |
| 102 EXPECT_TRUE(GetTestApi().host_widget()); | 100 EXPECT_TRUE(GetTestApi().host_widget()); |
| 103 | 101 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 154 |
| 157 // Make sure the window is initially placed correctly. | 155 // Make sure the window is initially placed correctly. |
| 158 GetEventGenerator().set_current_location(gfx::Point(50, 20)); | 156 GetEventGenerator().set_current_location(gfx::Point(50, 20)); |
| 159 EXPECT_FALSE(GetTestApi().is_active()); | 157 EXPECT_FALSE(GetTestApi().is_active()); |
| 160 GetEventGenerator().PressTouch(); | 158 GetEventGenerator().PressTouch(); |
| 161 EXPECT_EQ(GetEventGenerator().current_location() + offset, | 159 EXPECT_EQ(GetEventGenerator().current_location() + offset, |
| 162 GetTestApi().GetWidgetOrigin()); | 160 GetTestApi().GetWidgetOrigin()); |
| 163 } | 161 } |
| 164 | 162 |
| 165 } // namespace ash | 163 } // namespace ash |
| OLD | NEW |