| 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 | 4 |
| 5 #include "ash/autoclick/autoclick_controller.h" | 5 #include "ash/autoclick/autoclick_controller.h" |
| 6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
| 7 #include "ash/test/ash_test_base.h" | 7 #include "ash/test/ash_test_base.h" |
| 8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
| 9 #include "ui/aura/test/event_generator.h" | 9 #include "ui/aura/test/event_generator.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 events = WaitForMouseEvents(); | 211 events = WaitForMouseEvents(); |
| 212 EXPECT_EQ(2u, events.size()); | 212 EXPECT_EQ(2u, events.size()); |
| 213 EXPECT_EQ(0, events[0].flags() & ui::EF_CONTROL_DOWN); | 213 EXPECT_EQ(0, events[0].flags() & ui::EF_CONTROL_DOWN); |
| 214 EXPECT_EQ(0, events[0].flags() & ui::EF_SHIFT_DOWN); | 214 EXPECT_EQ(0, events[0].flags() & ui::EF_SHIFT_DOWN); |
| 215 EXPECT_EQ(ui::EF_ALT_DOWN, events[0].flags() & ui::EF_ALT_DOWN); | 215 EXPECT_EQ(ui::EF_ALT_DOWN, events[0].flags() & ui::EF_ALT_DOWN); |
| 216 } | 216 } |
| 217 | 217 |
| 218 TEST_F(AutoclickTest, ExtendedDisplay) { | 218 TEST_F(AutoclickTest, ExtendedDisplay) { |
| 219 UpdateDisplay("1280x1024,800x600"); | 219 UpdateDisplay("1280x1024,800x600"); |
| 220 RunAllPendingInMessageLoop(); | 220 RunAllPendingInMessageLoop(); |
| 221 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 221 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 222 EXPECT_EQ(2u, root_windows.size()); | 222 EXPECT_EQ(2u, root_windows.size()); |
| 223 | 223 |
| 224 GetAutoclickController()->SetEnabled(true); | 224 GetAutoclickController()->SetEnabled(true); |
| 225 std::vector<ui::MouseEvent> events; | 225 std::vector<ui::MouseEvent> events; |
| 226 | 226 |
| 227 // Test first root window. | 227 // Test first root window. |
| 228 aura::test::EventGenerator generator1(root_windows[0]); | 228 aura::test::EventGenerator generator1(root_windows[0]); |
| 229 generator1.MoveMouseTo(100, 200); | 229 generator1.MoveMouseTo(100, 200); |
| 230 events = WaitForMouseEvents(); | 230 events = WaitForMouseEvents(); |
| 231 EXPECT_EQ(2u, events.size()); | 231 EXPECT_EQ(2u, events.size()); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // Test scroll events. | 280 // Test scroll events. |
| 281 GetEventGenerator().MoveMouseTo(200, 200); | 281 GetEventGenerator().MoveMouseTo(200, 200); |
| 282 GetEventGenerator().ScrollSequence( | 282 GetEventGenerator().ScrollSequence( |
| 283 gfx::Point(100, 100), base::TimeDelta::FromMilliseconds(200), | 283 gfx::Point(100, 100), base::TimeDelta::FromMilliseconds(200), |
| 284 0, 100, 3, 2); | 284 0, 100, 3, 2); |
| 285 events = WaitForMouseEvents(); | 285 events = WaitForMouseEvents(); |
| 286 EXPECT_EQ(0u, events.size()); | 286 EXPECT_EQ(0u, events.size()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace ash | 289 } // namespace ash |
| OLD | NEW |