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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); | 1229 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); |
1230 | 1230 |
1231 // Ack'ing the outstanding event should flush the pending touch queue. | 1231 // Ack'ing the outstanding event should flush the pending touch queue. |
1232 InputEventAck ack(blink::WebInputEvent::TouchStart, | 1232 InputEventAck ack(blink::WebInputEvent::TouchStart, |
1233 INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, | 1233 INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, |
1234 press.unique_event_id()); | 1234 press.unique_event_id()); |
1235 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); | 1235 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); |
1236 EXPECT_EQ(0U, GetSentMessageCountAndResetSink()); | 1236 EXPECT_EQ(0U, GetSentMessageCountAndResetSink()); |
1237 | 1237 |
1238 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, | 1238 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, |
1239 base::Time::NowFromSystemTime() - base::Time()); | 1239 base::TimeTicks::Now()); |
1240 view_->OnTouchEvent(&move2); | 1240 view_->OnTouchEvent(&move2); |
1241 EXPECT_TRUE(press.synchronous_handling_disabled()); | 1241 EXPECT_TRUE(press.synchronous_handling_disabled()); |
1242 EXPECT_EQ(ui::MotionEvent::ACTION_MOVE, pointer_state().GetAction()); | 1242 EXPECT_EQ(ui::MotionEvent::ACTION_MOVE, pointer_state().GetAction()); |
1243 EXPECT_EQ(1U, pointer_state().GetPointerCount()); | 1243 EXPECT_EQ(1U, pointer_state().GetPointerCount()); |
1244 | 1244 |
1245 ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), 0, | 1245 ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), 0, |
1246 base::Time::NowFromSystemTime() - base::Time()); | 1246 base::TimeTicks::Now()); |
1247 view_->OnTouchEvent(&release2); | 1247 view_->OnTouchEvent(&release2); |
1248 EXPECT_TRUE(press.synchronous_handling_disabled()); | 1248 EXPECT_TRUE(press.synchronous_handling_disabled()); |
1249 EXPECT_EQ(0U, pointer_state().GetPointerCount()); | 1249 EXPECT_EQ(0U, pointer_state().GetPointerCount()); |
1250 } | 1250 } |
1251 | 1251 |
1252 // Checks that touch-event state is maintained correctly for multiple touch | 1252 // Checks that touch-event state is maintained correctly for multiple touch |
1253 // points. | 1253 // points. |
1254 TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) { | 1254 TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) { |
1255 view_->InitAsFullscreen(parent_view_); | 1255 view_->InitAsFullscreen(parent_view_); |
1256 view_->Show(); | 1256 view_->Show(); |
(...skipping 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4475 view()->OnGestureEvent(&gesture_event); | 4475 view()->OnGestureEvent(&gesture_event); |
4476 | 4476 |
4477 EXPECT_TRUE(delegate->context_menu_request_received()); | 4477 EXPECT_TRUE(delegate->context_menu_request_received()); |
4478 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); | 4478 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); |
4479 #endif | 4479 #endif |
4480 | 4480 |
4481 RenderViewHostFactory::set_is_real_render_view_host(false); | 4481 RenderViewHostFactory::set_is_real_render_view_host(false); |
4482 } | 4482 } |
4483 | 4483 |
4484 } // namespace content | 4484 } // namespace content |
OLD | NEW |