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 "ui/aura/window_targeter.h" | 5 #include "ui/aura/window_targeter.h" |
6 | 6 |
7 #include "ui/aura/test/aura_test_base.h" | 7 #include "ui/aura/test/aura_test_base.h" |
8 #include "ui/aura/test/test_event_handler.h" | 8 #include "ui/aura/test/test_event_handler.h" |
9 #include "ui/aura/test/test_window_delegate.h" | 9 #include "ui/aura/test/test_window_delegate.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 root_window()->Show(); | 32 root_window()->Show(); |
33 | 33 |
34 test::TestEventHandler handler; | 34 test::TestEventHandler handler; |
35 one->AddPreTargetHandler(&handler); | 35 one->AddPreTargetHandler(&handler); |
36 | 36 |
37 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, | 37 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, |
38 gfx::Point(20, 20), | 38 gfx::Point(20, 20), |
39 gfx::Point(20, 20), | 39 gfx::Point(20, 20), |
40 ui::EF_NONE, | 40 ui::EF_NONE, |
41 ui::EF_NONE); | 41 ui::EF_NONE); |
42 root_window()->GetDispatcher()->AsRootWindowHostDelegate()-> | 42 root_window()->GetDispatcher()->AsWindowTreeHostDelegate()-> |
43 OnHostMouseEvent(&press); | 43 OnHostMouseEvent(&press); |
44 EXPECT_EQ(1, handler.num_mouse_events()); | 44 EXPECT_EQ(1, handler.num_mouse_events()); |
45 | 45 |
46 handler.Reset(); | 46 handler.Reset(); |
47 ui::EventDispatchDetails details = | 47 ui::EventDispatchDetails details = |
48 root_window()->GetDispatcher()->OnEventFromSource(&press); | 48 root_window()->GetDispatcher()->OnEventFromSource(&press); |
49 EXPECT_FALSE(details.dispatcher_destroyed); | 49 EXPECT_FALSE(details.dispatcher_destroyed); |
50 EXPECT_EQ(1, handler.num_mouse_events()); | 50 EXPECT_EQ(1, handler.num_mouse_events()); |
51 | 51 |
52 one->RemovePreTargetHandler(&handler); | 52 one->RemovePreTargetHandler(&handler); |
53 } | 53 } |
54 | 54 |
55 } // namespace aura | 55 } // namespace aura |
OLD | NEW |