OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_event_dispatcher.h" | 5 #include "ui/aura/window_event_dispatcher.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 | 1308 |
1309 // Tests whether we can repost the Tap down gesture event. | 1309 // Tests whether we can repost the Tap down gesture event. |
1310 TEST_F(WindowEventDispatcherTest, RepostTapdownGestureTest) { | 1310 TEST_F(WindowEventDispatcherTest, RepostTapdownGestureTest) { |
1311 EventFilterRecorder recorder; | 1311 EventFilterRecorder recorder; |
1312 root_window()->AddPreTargetHandler(&recorder); | 1312 root_window()->AddPreTargetHandler(&recorder); |
1313 | 1313 |
1314 test::TestWindowDelegate delegate; | 1314 test::TestWindowDelegate delegate; |
1315 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( | 1315 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
1316 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); | 1316 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); |
1317 | 1317 |
1318 ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN, 0.0f, 0.0f); | 1318 ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN); |
1319 gfx::Point point(10, 10); | 1319 gfx::Point point(10, 10); |
1320 ui::GestureEvent event(point.x(), | 1320 ui::GestureEvent event(point.x(), |
1321 point.y(), | 1321 point.y(), |
1322 0, | 1322 0, |
1323 ui::EventTimeForNow(), | 1323 ui::EventTimeForNow(), |
1324 details); | 1324 details); |
1325 host()->dispatcher()->RepostEvent(event); | 1325 host()->dispatcher()->RepostEvent(event); |
1326 RunAllPendingInMessageLoop(); | 1326 RunAllPendingInMessageLoop(); |
1327 // TODO(rbyers): Currently disabled - crbug.com/170987 | 1327 // TODO(rbyers): Currently disabled - crbug.com/170987 |
1328 EXPECT_FALSE(EventTypesToString(recorder.events()).find("GESTURE_TAP_DOWN") != | 1328 EXPECT_FALSE(EventTypesToString(recorder.events()).find("GESTURE_TAP_DOWN") != |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 ui::EF_LEFT_MOUSE_BUTTON); | 2277 ui::EF_LEFT_MOUSE_BUTTON); |
2278 DispatchEventUsingWindowDispatcher(&mouse); | 2278 DispatchEventUsingWindowDispatcher(&mouse); |
2279 EXPECT_TRUE(recorder_first.events().empty()); | 2279 EXPECT_TRUE(recorder_first.events().empty()); |
2280 ASSERT_EQ(1u, recorder_second.events().size()); | 2280 ASSERT_EQ(1u, recorder_second.events().size()); |
2281 EXPECT_EQ(ui::ET_MOUSE_PRESSED, recorder_second.events()[0]); | 2281 EXPECT_EQ(ui::ET_MOUSE_PRESSED, recorder_second.events()[0]); |
2282 EXPECT_EQ(event_location.ToString(), | 2282 EXPECT_EQ(event_location.ToString(), |
2283 recorder_second.mouse_locations()[0].ToString()); | 2283 recorder_second.mouse_locations()[0].ToString()); |
2284 } | 2284 } |
2285 | 2285 |
2286 } // namespace aura | 2286 } // namespace aura |
OLD | NEW |