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

Side by Side Diff: ui/views/widget/widget_interactive_uitest.cc

Issue 565583005: Clean up GestureEventDetails constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Upload to the most recent patch 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
« no previous file with comments | « ui/views/widget/root_view_unittest.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 container->AddChildView(mouse); 294 container->AddChildView(mouse);
295 295
296 toplevel->SetSize(gfx::Size(100, 100)); 296 toplevel->SetSize(gfx::Size(100, 100));
297 toplevel->Show(); 297 toplevel->Show();
298 298
299 // Start a gesture on |gesture|. 299 // Start a gesture on |gesture|.
300 ui::GestureEvent tap_down(15, 300 ui::GestureEvent tap_down(15,
301 15, 301 15,
302 0, 302 0,
303 base::TimeDelta(), 303 base::TimeDelta(),
304 ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN, 304 ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN));
305 0,
306 0));
307 ui::GestureEvent end(15, 305 ui::GestureEvent end(15,
308 15, 306 15,
309 0, 307 0,
310 base::TimeDelta(), 308 base::TimeDelta(),
311 ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); 309 ui::GestureEventDetails(ui::ET_GESTURE_END));
312 toplevel->OnGestureEvent(&tap_down); 310 toplevel->OnGestureEvent(&tap_down);
313 311
314 // Now try to click on |mouse|. Since |gesture| will have capture, |mouse| 312 // Now try to click on |mouse|. Since |gesture| will have capture, |mouse|
315 // will not receive the event. 313 // will not receive the event.
316 gfx::Point click_location(45, 15); 314 gfx::Point click_location(45, 15);
317 315
318 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, click_location, click_location, 316 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, click_location, click_location,
319 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 317 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
320 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, click_location, click_location, 318 ui::MouseEvent release(ui::ET_MOUSE_RELEASED, click_location, click_location,
321 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); 319 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON);
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 ui::EventDispatchDetails details = widget1.GetNativeWindow()-> 1148 ui::EventDispatchDetails details = widget1.GetNativeWindow()->
1151 GetHost()->event_processor()->OnEventFromSource(&mouse_event); 1149 GetHost()->event_processor()->OnEventFromSource(&mouse_event);
1152 ASSERT_FALSE(details.dispatcher_destroyed); 1150 ASSERT_FALSE(details.dispatcher_destroyed);
1153 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent()); 1151 EXPECT_TRUE(widget1.GetAndClearGotMouseEvent());
1154 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent()); 1152 EXPECT_FALSE(widget2.GetAndClearGotMouseEvent());
1155 } 1153 }
1156 #endif // defined(OS_WIN) 1154 #endif // defined(OS_WIN)
1157 1155
1158 } // namespace test 1156 } // namespace test
1159 } // namespace views 1157 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/root_view_unittest.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698