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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); | 1235 widget_host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, false)); |
1236 | 1236 |
1237 // Ack'ing the outstanding event should flush the pending touch queue. | 1237 // Ack'ing the outstanding event should flush the pending touch queue. |
1238 InputEventAck ack(blink::WebInputEvent::TouchStart, | 1238 InputEventAck ack(blink::WebInputEvent::TouchStart, |
1239 INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, | 1239 INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, |
1240 press.unique_event_id()); | 1240 press.unique_event_id()); |
1241 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); | 1241 widget_host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); |
1242 EXPECT_EQ(0U, GetSentMessageCountAndResetSink()); | 1242 EXPECT_EQ(0U, GetSentMessageCountAndResetSink()); |
1243 | 1243 |
1244 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, | 1244 ui::TouchEvent move2(ui::ET_TOUCH_MOVED, gfx::Point(20, 20), 0, |
1245 base::Time::NowFromSystemTime() - base::Time()); | 1245 base::TimeTicks::Now()); |
1246 view_->OnTouchEvent(&move2); | 1246 view_->OnTouchEvent(&move2); |
1247 EXPECT_TRUE(press.synchronous_handling_disabled()); | 1247 EXPECT_TRUE(press.synchronous_handling_disabled()); |
1248 EXPECT_EQ(ui::MotionEvent::ACTION_MOVE, pointer_state().GetAction()); | 1248 EXPECT_EQ(ui::MotionEvent::ACTION_MOVE, pointer_state().GetAction()); |
1249 EXPECT_EQ(1U, pointer_state().GetPointerCount()); | 1249 EXPECT_EQ(1U, pointer_state().GetPointerCount()); |
1250 | 1250 |
1251 ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), 0, | 1251 ui::TouchEvent release2(ui::ET_TOUCH_RELEASED, gfx::Point(20, 20), 0, |
1252 base::Time::NowFromSystemTime() - base::Time()); | 1252 base::TimeTicks::Now()); |
1253 view_->OnTouchEvent(&release2); | 1253 view_->OnTouchEvent(&release2); |
1254 EXPECT_TRUE(press.synchronous_handling_disabled()); | 1254 EXPECT_TRUE(press.synchronous_handling_disabled()); |
1255 EXPECT_EQ(0U, pointer_state().GetPointerCount()); | 1255 EXPECT_EQ(0U, pointer_state().GetPointerCount()); |
1256 } | 1256 } |
1257 | 1257 |
1258 // Checks that touch-event state is maintained correctly for multiple touch | 1258 // Checks that touch-event state is maintained correctly for multiple touch |
1259 // points. | 1259 // points. |
1260 TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) { | 1260 TEST_F(RenderWidgetHostViewAuraTest, MultiTouchPointsStates) { |
1261 view_->InitAsFullscreen(parent_view_); | 1261 view_->InitAsFullscreen(parent_view_); |
1262 view_->Show(); | 1262 view_->Show(); |
(...skipping 3222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4485 view()->OnGestureEvent(&gesture_event); | 4485 view()->OnGestureEvent(&gesture_event); |
4486 | 4486 |
4487 EXPECT_TRUE(delegate->context_menu_request_received()); | 4487 EXPECT_TRUE(delegate->context_menu_request_received()); |
4488 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); | 4488 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); |
4489 #endif | 4489 #endif |
4490 | 4490 |
4491 RenderViewHostFactory::set_is_real_render_view_host(false); | 4491 RenderViewHostFactory::set_is_real_render_view_host(false); |
4492 } | 4492 } |
4493 | 4493 |
4494 } // namespace content | 4494 } // namespace content |
OLD | NEW |