| 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/test/event_generator.h" | 8 #include "ui/aura/test/event_generator.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class AutoclickTest : public test::AshTestBase { | 58 class AutoclickTest : public test::AshTestBase { |
| 59 public: | 59 public: |
| 60 AutoclickTest() {} | 60 AutoclickTest() {} |
| 61 virtual ~AutoclickTest() {} | 61 virtual ~AutoclickTest() {} |
| 62 | 62 |
| 63 virtual void SetUp() OVERRIDE { | 63 virtual void SetUp() OVERRIDE { |
| 64 test::AshTestBase::SetUp(); | 64 test::AshTestBase::SetUp(); |
| 65 Shell::GetInstance()->AddPreTargetHandler(&mouse_event_capturer_); | 65 Shell::GetInstance()->AddPreTargetHandler(&mouse_event_capturer_); |
| 66 GetAutoclickController()->SetClickWaitTime(0); | 66 GetAutoclickController()->SetAutoclickDelay(0); |
| 67 | 67 |
| 68 // Move mouse to deterministic location at the start of each test. | 68 // Move mouse to deterministic location at the start of each test. |
| 69 GetEventGenerator().MoveMouseTo(10, 10); | 69 GetEventGenerator().MoveMouseTo(10, 10); |
| 70 } | 70 } |
| 71 | 71 |
| 72 virtual void TearDown() OVERRIDE { | 72 virtual void TearDown() OVERRIDE { |
| 73 Shell::GetInstance()->RemovePreTargetHandler(&mouse_event_capturer_); | 73 Shell::GetInstance()->RemovePreTargetHandler(&mouse_event_capturer_); |
| 74 test::AshTestBase::TearDown(); | 74 test::AshTestBase::TearDown(); |
| 75 } | 75 } |
| 76 | 76 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // Test second root window. | 232 // Test second root window. |
| 233 aura::test::EventGenerator generator2(root_windows[1]); | 233 aura::test::EventGenerator generator2(root_windows[1]); |
| 234 generator2.MoveMouseTo(300, 400); | 234 generator2.MoveMouseTo(300, 400); |
| 235 events = WaitForMouseEvents(); | 235 events = WaitForMouseEvents(); |
| 236 EXPECT_EQ(2u, events.size()); | 236 EXPECT_EQ(2u, events.size()); |
| 237 EXPECT_EQ(300, events[0].root_location().x()); | 237 EXPECT_EQ(300, events[0].root_location().x()); |
| 238 EXPECT_EQ(400, events[0].root_location().y()); | 238 EXPECT_EQ(400, events[0].root_location().y()); |
| 239 } | 239 } |
| 240 | 240 |
| 241 } // namespace ash | 241 } // namespace ash |
| OLD | NEW |