| 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/test_window_delegate.h" | 8 #include "ui/aura/test/test_window_delegate.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 GetAutoclickController()->SetEnabled(true); | 273 GetAutoclickController()->SetEnabled(true); |
| 274 std::vector<ui::MouseEvent> events; | 274 std::vector<ui::MouseEvent> events; |
| 275 GetEventGenerator().MoveMouseTo(100, 100); | 275 GetEventGenerator().MoveMouseTo(100, 100); |
| 276 events = WaitForMouseEvents(); | 276 events = WaitForMouseEvents(); |
| 277 EXPECT_EQ(2u, events.size()); | 277 EXPECT_EQ(2u, events.size()); |
| 278 | 278 |
| 279 // Show a window and make sure the new window is under the cursor. As a | 279 // Show a window and make sure the new window is under the cursor. As a |
| 280 // result, synthesized mouse events will be dispatched to the window, but it | 280 // result, synthesized mouse events will be dispatched to the window, but it |
| 281 // should not trigger an autoclick. | 281 // should not trigger an autoclick. |
| 282 aura::test::EventCountDelegate delegate; | 282 aura::test::EventCountDelegate delegate; |
| 283 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithDelegate( | 283 std::unique_ptr<aura::Window> window(CreateTestWindowInShellWithDelegate( |
| 284 &delegate, 123, gfx::Rect(50, 50, 100, 100))); | 284 &delegate, 123, gfx::Rect(50, 50, 100, 100))); |
| 285 window->Show(); | 285 window->Show(); |
| 286 events = WaitForMouseEvents(); | 286 events = WaitForMouseEvents(); |
| 287 EXPECT_EQ(0u, events.size()); | 287 EXPECT_EQ(0u, events.size()); |
| 288 EXPECT_EQ("1 1 0", delegate.GetMouseMotionCountsAndReset()); | 288 EXPECT_EQ("1 1 0", delegate.GetMouseMotionCountsAndReset()); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace ash | 291 } // namespace ash |
| OLD | NEW |