Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: ui/aura/window_event_dispatcher_unittest.cc

Issue 565583005: Clean up GestureEventDetails constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alwasy set oldest_touch_id_ to -1 in the constructor Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698