diff options
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/controls/button/custom_button_unittest.cc | 2 | ||||
-rw-r--r-- | ui/views/controls/table/table_view_unittest.cc | 7 | ||||
-rw-r--r-- | ui/views/controls/textfield/textfield_unittest.cc | 46 | ||||
-rw-r--r-- | ui/views/corewm/desktop_capture_controller_unittest.cc | 11 | ||||
-rw-r--r-- | ui/views/touchui/touch_selection_controller_impl_unittest.cc | 40 | ||||
-rw-r--r-- | ui/views/view_targeter_unittest.cc | 16 | ||||
-rw-r--r-- | ui/views/widget/root_view_unittest.cc | 54 | ||||
-rw-r--r-- | ui/views/widget/widget_interactive_uitest.cc | 6 | ||||
-rw-r--r-- | ui/views/widget/widget_unittest.cc | 58 |
9 files changed, 138 insertions, 102 deletions
diff --git a/ui/views/controls/button/custom_button_unittest.cc b/ui/views/controls/button/custom_button_unittest.cc index a5d97c9..49d9987 100644 --- a/ui/views/controls/button/custom_button_unittest.cc +++ b/ui/views/controls/button/custom_button_unittest.cc @@ -36,7 +36,7 @@ class TestCustomButton : public CustomButton { }; void PerformGesture(CustomButton* button, ui::EventType event_type) { - ui::GestureEventDetails gesture_details(event_type); + ui::GestureEventDetails gesture_details(event_type, 0, 0); base::TimeDelta time_stamp = base::TimeDelta::FromMicroseconds(0); ui::GestureEvent gesture_event(0, 0, 0, time_stamp, gesture_details); button->OnGestureEvent(&gesture_event); diff --git a/ui/views/controls/table/table_view_unittest.cc b/ui/views/controls/table/table_view_unittest.cc index 6ce06c8..e592f2e 100644 --- a/ui/views/controls/table/table_view_unittest.cc +++ b/ui/views/controls/table/table_view_unittest.cc @@ -198,7 +198,8 @@ class TableViewTest : public testing::Test { void TapOnRow(int row) { const int y = row * table_->row_height(); - const ui::GestureEventDetails event_details(ui::ET_GESTURE_TAP); + const ui::GestureEventDetails event_details(ui::ET_GESTURE_TAP, + .0f, .0f); ui::GestureEvent tap(0, y, 0, base::TimeDelta(), event_details); table_->OnGestureEvent(&tap); } @@ -311,14 +312,14 @@ TEST_F(TableViewTest, ResizeViaGesture) { 0, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN)); + ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN, .0f, .0f)); helper_->header()->OnGestureEvent(&scroll_begin); ui::GestureEvent scroll_update( x - 1, 0, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_UPDATE)); + ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_UPDATE, .0f, .0f)); helper_->header()->OnGestureEvent(&scroll_update); // This should shrink the first column and pull the second column in. diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc index b7a6117..2cd92c0 100644 --- a/ui/views/controls/textfield/textfield_unittest.cc +++ b/ui/views/controls/textfield/textfield_unittest.cc @@ -103,8 +103,16 @@ class TestTextfield : public views::Textfield { // Convenience to make constructing a GestureEvent simpler. class GestureEventForTest : public ui::GestureEvent { public: - GestureEventForTest(int x, int y, ui::GestureEventDetails details) - : GestureEvent(x, y, 0, base::TimeDelta(), details) {} + GestureEventForTest(ui::EventType type, + int x, + int y, + float delta_x, + float delta_y) + : GestureEvent(x, + y, + 0, + base::TimeDelta(), + ui::GestureEventDetails(type, delta_x, delta_y)) {} private: DISALLOW_COPY_AND_ASSIGN(GestureEventForTest); @@ -322,26 +330,23 @@ class TextfieldTest : public ViewsTestBase, public TextfieldController { // Simulates a complete tap. void Tap(const gfx::Point& point) { GestureEventForTest begin( - point.x(), point.y(), ui::GestureEventDetails(ui::ET_GESTURE_BEGIN)); + ui::ET_GESTURE_BEGIN, point.x(), point.y(), 0.0f, 0.0f); textfield_->OnGestureEvent(&begin); GestureEventForTest tap_down( - point.x(), point.y(), ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN)); + ui::ET_GESTURE_TAP_DOWN, point.x(), point.y(), 0.0f, 0.0f); textfield_->OnGestureEvent(&tap_down); GestureEventForTest show_press( - point.x(), - point.y(), - ui::GestureEventDetails(ui::ET_GESTURE_SHOW_PRESS)); + ui::ET_GESTURE_SHOW_PRESS, point.x(), point.y(), 0.0f, 0.0f); textfield_->OnGestureEvent(&show_press); - ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP); - tap_details.set_tap_count(1); - GestureEventForTest tap(point.x(), point.y(), tap_details); + GestureEventForTest tap( + ui::ET_GESTURE_TAP, point.x(), point.y(), 1.0f, 0.0f); textfield_->OnGestureEvent(&tap); GestureEventForTest end( - point.x(), point.y(), ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::ET_GESTURE_END, point.x(), point.y(), 0.0f, 0.0f); textfield_->OnGestureEvent(&end); } @@ -1952,9 +1957,7 @@ TEST_F(TextfieldTest, TouchSelectionAndDraggingTest) { CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableTouchEditing); // Tapping on the textfield should turn on the TouchSelectionController. - ui::GestureEventDetails tap_details(ui::ET_GESTURE_TAP); - tap_details.set_tap_count(1); - GestureEventForTest tap(x, 0, tap_details); + GestureEventForTest tap(ui::ET_GESTURE_TAP, x, 0, 1.0f, 0.0f); textfield_->OnGestureEvent(&tap); EXPECT_TRUE(test_api_->touch_selection_controller()); @@ -1965,8 +1968,7 @@ TEST_F(TextfieldTest, TouchSelectionAndDraggingTest) { // With touch editing enabled, long press should not show context menu. // Instead, select word and invoke TouchSelectionController. - GestureEventForTest long_press_1( - x, 0, ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + GestureEventForTest long_press_1(ui::ET_GESTURE_LONG_PRESS, x, 0, 0.0f, 0.0f); textfield_->OnGestureEvent(&long_press_1); EXPECT_STR_EQ("hello", textfield_->GetSelectedText()); EXPECT_TRUE(test_api_->touch_selection_controller()); @@ -1975,8 +1977,7 @@ TEST_F(TextfieldTest, TouchSelectionAndDraggingTest) { // With touch drag drop enabled, long pressing in the selected region should // start a drag and remove TouchSelectionController. ASSERT_TRUE(switches::IsTouchDragDropEnabled()); - GestureEventForTest long_press_2( - x, 0, ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + GestureEventForTest long_press_2(ui::ET_GESTURE_LONG_PRESS, x, 0, 0.0f, 0.0f); textfield_->OnGestureEvent(&long_press_2); EXPECT_STR_EQ("hello", textfield_->GetSelectedText()); EXPECT_FALSE(test_api_->touch_selection_controller()); @@ -1987,8 +1988,7 @@ TEST_F(TextfieldTest, TouchSelectionAndDraggingTest) { CommandLine::ForCurrentProcess()->AppendSwitch( switches::kDisableTouchDragDrop); ASSERT_FALSE(switches::IsTouchDragDropEnabled()); - GestureEventForTest long_press_3( - x, 0, ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + GestureEventForTest long_press_3(ui::ET_GESTURE_LONG_PRESS, x, 0, 0.0f, 0.0f); textfield_->OnGestureEvent(&long_press_3); EXPECT_STR_EQ("hello", textfield_->GetSelectedText()); EXPECT_FALSE(test_api_->touch_selection_controller()); @@ -2033,10 +2033,8 @@ TEST_F(TextfieldTest, TestLongPressInitiatesDragDrop) { switches::kEnableTouchDragDrop); // Create a long press event in the selected region should start a drag. - GestureEventForTest long_press( - kStringPoint.x(), - kStringPoint.y(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + GestureEventForTest long_press(ui::ET_GESTURE_LONG_PRESS, kStringPoint.x(), + kStringPoint.y(), 0.0f, 0.0f); textfield_->OnGestureEvent(&long_press); EXPECT_TRUE(textfield_->CanStartDragForView(NULL, kStringPoint, kStringPoint)); diff --git a/ui/views/corewm/desktop_capture_controller_unittest.cc b/ui/views/corewm/desktop_capture_controller_unittest.cc index 3baf0f4..a7628a6 100644 --- a/ui/views/corewm/desktop_capture_controller_unittest.cc +++ b/ui/views/corewm/desktop_capture_controller_unittest.cc @@ -167,11 +167,12 @@ TEST_F(DesktopCaptureControllerTest, CaptureWindowInputEventTest) { EXPECT_FALSE(widget2->GetNativeView()->HasCapture()); EXPECT_EQ(capture_client->GetCaptureWindow(), widget1->GetNativeView()); - ui::GestureEvent g1(80, - 80, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + ui::GestureEvent g1( + 80, + 80, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0.0f, 0.0f)); details = root1->OnEventFromSource(&g1); EXPECT_FALSE(details.dispatcher_destroyed); EXPECT_FALSE(details.target_destroyed); diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc index b268d2c..acd62ff 100644 --- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc +++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc @@ -252,9 +252,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInTextfieldTest) { CreateTextfield(); textfield_->SetText(ASCIIToUTF16("some text")); // Tap the textfield to invoke touch selection. - ui::GestureEventDetails details(ui::ET_GESTURE_TAP); - details.set_tap_count(1); - ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); + ui::GestureEvent tap(0, + 0, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); textfield_->OnGestureEvent(&tap); // Test selecting a range. @@ -285,9 +287,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectionInBidiTextfieldTest) { CreateTextfield(); textfield_->SetText(WideToUTF16(L"abc\x05d0\x05d1\x05d2")); // Tap the textfield to invoke touch selection. - ui::GestureEventDetails details(ui::ET_GESTURE_TAP); - details.set_tap_count(1); - ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); + ui::GestureEvent tap(0, + 0, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); textfield_->OnGestureEvent(&tap); // Test cursor at run boundary and with empty selection. @@ -334,9 +338,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectCallbackTest) { CreateTextfield(); textfield_->SetText(ASCIIToUTF16("textfield with selected text")); // Tap the textfield to invoke touch selection. - ui::GestureEventDetails details(ui::ET_GESTURE_TAP); - details.set_tap_count(1); - ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); + ui::GestureEvent tap(0, + 0, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); textfield_->OnGestureEvent(&tap); textfield_->SelectRange(gfx::Range(3, 7)); @@ -373,9 +379,11 @@ TEST_F(TouchSelectionControllerImplTest, SelectRectInBidiCallbackTest) { CreateTextfield(); textfield_->SetText(WideToUTF16(L"abc\x05e1\x05e2\x05e3" L"def")); // Tap the textfield to invoke touch selection. - ui::GestureEventDetails details(ui::ET_GESTURE_TAP); - details.set_tap_count(1); - ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); + ui::GestureEvent tap(0, + 0, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); textfield_->OnGestureEvent(&tap); // Select [c] from left to right. @@ -503,9 +511,11 @@ TEST_F(TouchSelectionControllerImplTest, textfield_->SetText(ASCIIToUTF16(textfield_text)); // Tap the textfield to invoke selection. - ui::GestureEventDetails details(ui::ET_GESTURE_TAP); - details.set_tap_count(1); - ui::GestureEvent tap(0, 0, 0, base::TimeDelta(), details); + ui::GestureEvent tap(0, + 0, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP, 1.0f, 0.0f)); textfield_->OnGestureEvent(&tap); // Select some text such that one handle is hidden. diff --git a/ui/views/view_targeter_unittest.cc b/ui/views/view_targeter_unittest.cc index b855161..92d0fd6 100644 --- a/ui/views/view_targeter_unittest.cc +++ b/ui/views/view_targeter_unittest.cc @@ -231,7 +231,7 @@ class GestureEventForTest : public ui::GestureEvent { y, 0, base::TimeDelta(), - ui::GestureEventDetails(type)) {} + ui::GestureEventDetails(type, 0.0f, 0.0f)) {} GestureEventForTest(ui::GestureEventDetails details, int x, int y) : GestureEvent(x, y, 0, base::TimeDelta(), details) {} @@ -266,13 +266,13 @@ TEST_F(ViewTargeterTest, ViewTargeterForGestureEvents) { // Define some gesture events for testing. gfx::Rect bounding_box(gfx::Point(46, 46), gfx::Size(8, 8)); gfx::Point center_point(bounding_box.CenterPoint()); - ui::GestureEventDetails details(ui::ET_GESTURE_TAP); + ui::GestureEventDetails details(ui::ET_GESTURE_TAP, 0.0f, 0.0f); details.set_bounding_box(bounding_box); GestureEventForTest tap(details, center_point.x(), center_point.y()); - details = ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN); + details = ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN, 0.0f, 0.0f); details.set_bounding_box(bounding_box); GestureEventForTest scroll_begin(details, center_point.x(), center_point.y()); - details = ui::GestureEventDetails(ui::ET_GESTURE_END); + details = ui::GestureEventDetails(ui::ET_GESTURE_END, 0.0f, 0.0f); details.set_bounding_box(bounding_box); GestureEventForTest end(details, center_point.x(), center_point.y()); @@ -324,14 +324,14 @@ TEST_F(ViewTargeterTest, ViewTargeterForGestureEvents) { // again (calls to FindTargetForEvent() and FindNextBestTarget() // mutate the location of the gesture events to be in the coordinate // space of the returned view). - details = ui::GestureEventDetails(ui::ET_GESTURE_TAP); + details = ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0.0f, 0.0f); details.set_bounding_box(bounding_box); tap = GestureEventForTest(details, center_point.x(), center_point.y()); - details = ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN); + details = ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN, 0.0f, 0.0f); details.set_bounding_box(bounding_box); scroll_begin = GestureEventForTest(details, center_point.x(), center_point.y()); - details = ui::GestureEventDetails(ui::ET_GESTURE_END); + details = ui::GestureEventDetails(ui::ET_GESTURE_END, 0.0f, 0.0f); details.set_bounding_box(bounding_box); end = GestureEventForTest(details, center_point.x(), center_point.y()); @@ -381,7 +381,7 @@ TEST_F(ViewTargeterTest, GestureEventCoordinateConversion) { // in root view coordinates with width and height of 4. gfx::Rect bounding_box(gfx::Point(58, 58), gfx::Size(4, 4)); gfx::Point center_point(bounding_box.CenterPoint()); - ui::GestureEventDetails details(ui::ET_GESTURE_TAP); + ui::GestureEventDetails details(ui::ET_GESTURE_TAP, 0.0f, 0.0f); details.set_bounding_box(bounding_box); GestureEventForTest tap(details, center_point.x(), center_point.y()); diff --git a/ui/views/widget/root_view_unittest.cc b/ui/views/widget/root_view_unittest.cc index f4836cd..d13e6c99 100644 --- a/ui/views/widget/root_view_unittest.cc +++ b/ui/views/widget/root_view_unittest.cc @@ -206,11 +206,14 @@ TEST_F(RootViewTest, ContextMenuFromLongPress) { 5, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0, 0)); ui::EventDispatchDetails details = root_view->OnEventFromSource(&long_press1); - ui::GestureEvent end1( - 5, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::GestureEvent end1(5, + 5, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); details = root_view->OnEventFromSource(&end1); EXPECT_FALSE(details.target_destroyed); @@ -225,11 +228,14 @@ TEST_F(RootViewTest, ContextMenuFromLongPress) { 5, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0, 0)); details = root_view->OnEventFromSource(&long_press2); - ui::GestureEvent end2( - 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::GestureEvent end2(25, + 5, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); details = root_view->OnEventFromSource(&end2); EXPECT_FALSE(details.target_destroyed); @@ -244,11 +250,14 @@ TEST_F(RootViewTest, ContextMenuFromLongPress) { 50, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0, 0)); details = root_view->OnEventFromSource(&long_press3); - ui::GestureEvent end3( - 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::GestureEvent end3(25, + 5, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); details = root_view->OnEventFromSource(&end3); EXPECT_FALSE(details.target_destroyed); @@ -291,11 +300,14 @@ TEST_F(RootViewTest, ContextMenuFromLongPressOnDisabledView) { 5, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0, 0)); ui::EventDispatchDetails details = root_view->OnEventFromSource(&long_press1); - ui::GestureEvent end1( - 5, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::GestureEvent end1(5, + 5, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); details = root_view->OnEventFromSource(&end1); EXPECT_FALSE(details.target_destroyed); @@ -310,11 +322,14 @@ TEST_F(RootViewTest, ContextMenuFromLongPressOnDisabledView) { 5, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0, 0)); details = root_view->OnEventFromSource(&long_press2); - ui::GestureEvent end2( - 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::GestureEvent end2(25, + 5, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); details = root_view->OnEventFromSource(&end2); EXPECT_FALSE(details.target_destroyed); @@ -329,11 +344,14 @@ TEST_F(RootViewTest, ContextMenuFromLongPressOnDisabledView) { 50, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS)); + ui::GestureEventDetails(ui::ET_GESTURE_LONG_PRESS, 0, 0)); details = root_view->OnEventFromSource(&long_press3); - ui::GestureEvent end3( - 25, 5, 0, base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::GestureEvent end3(25, + 5, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); details = root_view->OnEventFromSource(&end3); EXPECT_FALSE(details.target_destroyed); diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc index 68d646c..d3827df 100644 --- a/ui/views/widget/widget_interactive_uitest.cc +++ b/ui/views/widget/widget_interactive_uitest.cc @@ -301,12 +301,14 @@ TEST_F(WidgetTestInteractive, ResetCaptureOnGestureEnd) { 15, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN)); + ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN, + 0, + 0)); ui::GestureEvent end(15, 15, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_END)); + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0)); toplevel->OnGestureEvent(&tap_down); // Now try to click on |mouse|. Since |gesture| will have capture, |mouse| diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc index e006e06..2dc6b24 100644 --- a/ui/views/widget/widget_unittest.cc +++ b/ui/views/widget/widget_unittest.cc @@ -1339,7 +1339,7 @@ TEST_F(WidgetTest, GestureScrollEventDispatching) { 5, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN)); + ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN, 0, 0)); widget->OnGestureEvent(&begin); ui::GestureEvent update( 25, @@ -1348,11 +1348,12 @@ TEST_F(WidgetTest, GestureScrollEventDispatching) { base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_UPDATE, 20, 10)); widget->OnGestureEvent(&update); - ui::GestureEvent end(25, - 15, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_END)); + ui::GestureEvent end( + 25, + 15, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_END, 0, 0)); widget->OnGestureEvent(&end); EXPECT_EQ(1, noscroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_BEGIN)); @@ -1366,7 +1367,7 @@ TEST_F(WidgetTest, GestureScrollEventDispatching) { 5, 0, base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN)); + ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_BEGIN, 0, 0)); widget->OnGestureEvent(&begin); ui::GestureEvent update( 85, @@ -1375,11 +1376,12 @@ TEST_F(WidgetTest, GestureScrollEventDispatching) { base::TimeDelta(), ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_UPDATE, 20, 10)); widget->OnGestureEvent(&update); - ui::GestureEvent end(85, - 15, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_END)); + ui::GestureEvent end( + 85, + 15, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_SCROLL_END, 0, 0)); widget->OnGestureEvent(&end); EXPECT_EQ(1, scroll_view->GetEventCount(ui::ET_GESTURE_SCROLL_BEGIN)); @@ -1468,18 +1470,21 @@ TEST_F(WidgetTest, EventHandlersOnRootView) { 5, 0, ui::EventTimeForNow(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN)); + ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN, + 0, + 0)); widget->OnGestureEvent(&tap_down); EXPECT_EQ(1, h1.GetEventCount(ui::ET_GESTURE_TAP_DOWN)); EXPECT_EQ(1, view->GetEventCount(ui::ET_GESTURE_TAP_DOWN)); EXPECT_EQ(0, h2.GetEventCount(ui::ET_GESTURE_TAP_DOWN)); - ui::GestureEvent tap_cancel( - 5, - 5, - 0, - ui::EventTimeForNow(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP_CANCEL)); + ui::GestureEvent tap_cancel(5, + 5, + 0, + ui::EventTimeForNow(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP_CANCEL, + 0, + 0)); widget->OnGestureEvent(&tap_cancel); EXPECT_EQ(1, h1.GetEventCount(ui::ET_GESTURE_TAP_CANCEL)); EXPECT_EQ(1, view->GetEventCount(ui::ET_GESTURE_TAP_CANCEL)); @@ -1949,11 +1954,12 @@ TEST_F(WidgetTest, MAYBE_DisableTestRootViewHandlersWhenHidden) { // Check RootView::gesture_handler_. widget->Show(); EXPECT_EQ(NULL, GetGestureHandler(root_view)); - ui::GestureEvent tap_down(15, - 15, - 0, - base::TimeDelta(), - ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN)); + ui::GestureEvent tap_down( + 15, + 15, + 0, + base::TimeDelta(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP_DOWN, 0, 0)); widget->OnGestureEvent(&tap_down); EXPECT_EQ(view, GetGestureHandler(root_view)); widget->Hide(); @@ -1970,7 +1976,7 @@ class GestureEventForTest : public ui::GestureEvent { y, 0, base::TimeDelta(), - ui::GestureEventDetails(type)) {} + ui::GestureEventDetails(type, 0.0f, 0.0f)) {} GestureEventForTest(ui::GestureEventDetails details, int x, int y) : GestureEvent(x, y, 0, base::TimeDelta(), details) {} @@ -2023,7 +2029,7 @@ TEST_F(WidgetTest, GestureBeginAndEndEvents) { // If no gesture handler is set, dispatching only a ui::ET_GESTURE_BEGIN // corresponding to a second touch point should not set the gesture handler // and should not be marked as handled because it is never dispatched. - ui::GestureEventDetails details(ui::ET_GESTURE_END); + ui::GestureEventDetails details(ui::ET_GESTURE_END, 15, 15); details.set_touch_points(2); GestureEventForTest end_second_touch_point(details, 15, 15); widget->OnGestureEvent(&end_second_touch_point); |