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 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 | 1315 |
1316 // Tests whether we can repost the Tap down gesture event. | 1316 // Tests whether we can repost the Tap down gesture event. |
1317 TEST_F(WindowEventDispatcherTest, RepostTapdownGestureTest) { | 1317 TEST_F(WindowEventDispatcherTest, RepostTapdownGestureTest) { |
1318 EventFilterRecorder recorder; | 1318 EventFilterRecorder recorder; |
1319 root_window()->AddPreTargetHandler(&recorder); | 1319 root_window()->AddPreTargetHandler(&recorder); |
1320 | 1320 |
1321 test::TestWindowDelegate delegate; | 1321 test::TestWindowDelegate delegate; |
1322 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( | 1322 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate( |
1323 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); | 1323 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window())); |
1324 | 1324 |
1325 ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN); | 1325 ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN, 0.0f, 0.0f); |
1326 gfx::Point point(10, 10); | 1326 gfx::Point point(10, 10); |
1327 ui::GestureEvent event(point.x(), | 1327 ui::GestureEvent event(point.x(), |
1328 point.y(), | 1328 point.y(), |
1329 0, | 1329 0, |
1330 ui::EventTimeForNow(), | 1330 ui::EventTimeForNow(), |
1331 details); | 1331 details); |
1332 host()->dispatcher()->RepostEvent(event); | 1332 host()->dispatcher()->RepostEvent(event); |
1333 RunAllPendingInMessageLoop(); | 1333 RunAllPendingInMessageLoop(); |
1334 // TODO(rbyers): Currently disabled - crbug.com/170987 | 1334 // TODO(rbyers): Currently disabled - crbug.com/170987 |
1335 EXPECT_FALSE(EventTypesToString(recorder.events()).find("GESTURE_TAP_DOWN") != | 1335 EXPECT_FALSE(EventTypesToString(recorder.events()).find("GESTURE_TAP_DOWN") != |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2340 ASSERT_EQ(1u, recorder.touch_locations().size()); | 2340 ASSERT_EQ(1u, recorder.touch_locations().size()); |
2341 EXPECT_EQ(gfx::Point(kX - kWindowOffset, kY - kWindowOffset).ToString(), | 2341 EXPECT_EQ(gfx::Point(kX - kWindowOffset, kY - kWindowOffset).ToString(), |
2342 recorder.touch_locations()[0].ToString()); | 2342 recorder.touch_locations()[0].ToString()); |
2343 | 2343 |
2344 ASSERT_EQ(2u, recorder.gesture_locations().size()); | 2344 ASSERT_EQ(2u, recorder.gesture_locations().size()); |
2345 EXPECT_EQ(gfx::Point(kX - kWindowOffset, kY - kWindowOffset).ToString(), | 2345 EXPECT_EQ(gfx::Point(kX - kWindowOffset, kY - kWindowOffset).ToString(), |
2346 recorder.gesture_locations()[0].ToString()); | 2346 recorder.gesture_locations()[0].ToString()); |
2347 } | 2347 } |
2348 | 2348 |
2349 } // namespace aura | 2349 } // namespace aura |
OLD | NEW |