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

Unified Diff: ui/views/widget/widget_unittest.cc

Issue 12088015: Add ability for EventGenerator to generate Scroll events asynchronously (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Free any leftover events in destructor Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/events/event.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/widget_unittest.cc
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index c23fd0f6d0d6bbdd972abd08e5e0ad3d6f5f26d3..f42b877c86fee0eed3f0ed6a370a73d7680aecb5 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -7,6 +7,7 @@
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/events/event_utils.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/point.h"
#include "ui/views/bubble/bubble_delegate.h"
@@ -1290,7 +1291,13 @@ TEST_F(WidgetTest, WheelEventsFromScrollEventTarget) {
// Generate a scroll event on the cursor view. The focused view will receive a
// wheel event, but since it doesn't process the event, the view under the
// cursor will receive the wheel event.
- ui::ScrollEvent scroll(ui::ET_SCROLL, gfx::Point(65, 5), 0, 0, 20);
+ ui::ScrollEvent scroll(ui::ET_SCROLL,
+ gfx::Point(65, 5),
+ ui::EventTimeForNow(),
+ 0,
+ 0,
+ 20,
+ 2);
widget->OnScrollEvent(&scroll);
EXPECT_EQ(0, focused_view->GetEventCount(ui::ET_SCROLL));
@@ -1302,7 +1309,13 @@ TEST_F(WidgetTest, WheelEventsFromScrollEventTarget) {
focused_view->ResetCounts();
cursor_view->ResetCounts();
- ui::ScrollEvent scroll2(ui::ET_SCROLL, gfx::Point(5, 5), 0, 0, 20);
+ ui::ScrollEvent scroll2(ui::ET_SCROLL,
+ gfx::Point(5, 5),
+ ui::EventTimeForNow(),
+ 0,
+ 0,
+ 20,
+ 2);
widget->OnScrollEvent(&scroll2);
EXPECT_EQ(1, focused_view->GetEventCount(ui::ET_SCROLL));
EXPECT_EQ(1, focused_view->GetEventCount(ui::ET_MOUSEWHEEL));
« no previous file with comments | « ui/base/events/event.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698