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

Side by Side Diff: content/browser/renderer_host/input/input_router_impl_unittest.cc

Issue 2863693003: Unify TouchAction classes (Closed)
Patch Set: add cstdlib Created 3 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "content/browser/renderer_host/input/input_router_impl.h" 5 #include "content/browser/renderer_host/input/input_router_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 #include <tuple> 12 #include <tuple>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/location.h" 16 #include "base/location.h"
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/memory/ptr_util.h" 18 #include "base/memory/ptr_util.h"
19 #include "base/run_loop.h" 19 #include "base/run_loop.h"
20 #include "base/single_thread_task_runner.h" 20 #include "base/single_thread_task_runner.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/test/scoped_feature_list.h" 22 #include "base/test/scoped_feature_list.h"
23 #include "base/test/scoped_task_environment.h" 23 #include "base/test/scoped_task_environment.h"
24 #include "base/threading/thread_task_runner_handle.h" 24 #include "base/threading/thread_task_runner_handle.h"
25 #include "build/build_config.h" 25 #include "build/build_config.h"
26 #include "cc/input/touch_action.h"
26 #include "content/browser/renderer_host/input/gesture_event_queue.h" 27 #include "content/browser/renderer_host/input/gesture_event_queue.h"
27 #include "content/browser/renderer_host/input/input_router_client.h" 28 #include "content/browser/renderer_host/input/input_router_client.h"
28 #include "content/browser/renderer_host/input/mock_input_ack_handler.h" 29 #include "content/browser/renderer_host/input/mock_input_ack_handler.h"
29 #include "content/browser/renderer_host/input/mock_input_router_client.h" 30 #include "content/browser/renderer_host/input/mock_input_router_client.h"
30 #include "content/common/content_constants_internal.h" 31 #include "content/common/content_constants_internal.h"
31 #include "content/common/edit_command.h" 32 #include "content/common/edit_command.h"
32 #include "content/common/input/synthetic_web_input_event_builders.h" 33 #include "content/common/input/synthetic_web_input_event_builders.h"
33 #include "content/common/input/touch_action.h"
34 #include "content/common/input_messages.h" 34 #include "content/common/input_messages.h"
35 #include "content/common/view_messages.h" 35 #include "content/common/view_messages.h"
36 #include "content/public/common/content_features.h" 36 #include "content/public/common/content_features.h"
37 #include "content/public/common/content_switches.h" 37 #include "content/public/common/content_switches.h"
38 #include "content/public/test/mock_render_process_host.h" 38 #include "content/public/test/mock_render_process_host.h"
39 #include "content/public/test/test_browser_context.h" 39 #include "content/public/test/test_browser_context.h"
40 #include "testing/gtest/include/gtest/gtest.h" 40 #include "testing/gtest/include/gtest/gtest.h"
41 #include "ui/events/base_event_utils.h" 41 #include "ui/events/base_event_utils.h"
42 #include "ui/events/blink/web_input_event_traits.h" 42 #include "ui/events/blink/web_input_event_traits.h"
43 #include "ui/events/keycodes/keyboard_codes.h" 43 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 361
362 bool HasPendingEvents() const { 362 bool HasPendingEvents() const {
363 return input_router_->HasPendingEvents(); 363 return input_router_->HasPendingEvents();
364 } 364 }
365 365
366 void OnHasTouchEventHandlers(bool has_handlers) { 366 void OnHasTouchEventHandlers(bool has_handlers) {
367 input_router_->OnMessageReceived( 367 input_router_->OnMessageReceived(
368 ViewHostMsg_HasTouchEventHandlers(0, has_handlers)); 368 ViewHostMsg_HasTouchEventHandlers(0, has_handlers));
369 } 369 }
370 370
371 void OnSetTouchAction(content::TouchAction touch_action) { 371 void OnSetTouchAction(cc::TouchAction touch_action) {
372 input_router_->OnMessageReceived( 372 input_router_->OnMessageReceived(
373 InputHostMsg_SetTouchAction(0, touch_action)); 373 InputHostMsg_SetTouchAction(0, touch_action));
374 } 374 }
375 375
376 size_t GetSentMessageCountAndResetSink() { 376 size_t GetSentMessageCountAndResetSink() {
377 size_t count = process_->sink().message_count(); 377 size_t count = process_->sink().message_count();
378 process_->sink().ClearMessages(); 378 process_->sink().ClearMessages();
379 return count; 379 return count;
380 } 380 }
381 381
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 ASSERT_TRUE(TouchEventTimeoutEnabled()); 1373 ASSERT_TRUE(TouchEventTimeoutEnabled());
1374 1374
1375 // A mobile-optimized site should use the mobile timeout. For this test that 1375 // A mobile-optimized site should use the mobile timeout. For this test that
1376 // timeout value is 0, which disables the timeout. 1376 // timeout value is 0, which disables the timeout.
1377 input_router()->NotifySiteIsMobileOptimized(true); 1377 input_router()->NotifySiteIsMobileOptimized(true);
1378 EXPECT_FALSE(TouchEventTimeoutEnabled()); 1378 EXPECT_FALSE(TouchEventTimeoutEnabled());
1379 1379
1380 input_router()->NotifySiteIsMobileOptimized(false); 1380 input_router()->NotifySiteIsMobileOptimized(false);
1381 EXPECT_TRUE(TouchEventTimeoutEnabled()); 1381 EXPECT_TRUE(TouchEventTimeoutEnabled());
1382 1382
1383 // TOUCH_ACTION_NONE (and no other touch-action) should disable the timeout. 1383 // kTouchActionNone (and no other touch-action) should disable the timeout.
1384 OnHasTouchEventHandlers(true); 1384 OnHasTouchEventHandlers(true);
1385 PressTouchPoint(1, 1); 1385 PressTouchPoint(1, 1);
1386 uint32_t touch_press_event_id2 = SendTouchEvent(); 1386 uint32_t touch_press_event_id2 = SendTouchEvent();
1387 OnSetTouchAction(TOUCH_ACTION_PAN_Y); 1387 OnSetTouchAction(cc::kTouchActionPanY);
1388 EXPECT_TRUE(TouchEventTimeoutEnabled()); 1388 EXPECT_TRUE(TouchEventTimeoutEnabled());
1389 ReleaseTouchPoint(0); 1389 ReleaseTouchPoint(0);
1390 uint32_t touch_release_event_id2 = SendTouchEvent(); 1390 uint32_t touch_release_event_id2 = SendTouchEvent();
1391 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1391 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1392 touch_press_event_id2); 1392 touch_press_event_id2);
1393 SendTouchEventACK(WebInputEvent::kTouchEnd, INPUT_EVENT_ACK_STATE_CONSUMED, 1393 SendTouchEventACK(WebInputEvent::kTouchEnd, INPUT_EVENT_ACK_STATE_CONSUMED,
1394 touch_release_event_id2); 1394 touch_release_event_id2);
1395 1395
1396 PressTouchPoint(1, 1); 1396 PressTouchPoint(1, 1);
1397 uint32_t touch_press_event_id3 = SendTouchEvent(); 1397 uint32_t touch_press_event_id3 = SendTouchEvent();
1398 OnSetTouchAction(TOUCH_ACTION_NONE); 1398 OnSetTouchAction(cc::kTouchActionNone);
1399 EXPECT_FALSE(TouchEventTimeoutEnabled()); 1399 EXPECT_FALSE(TouchEventTimeoutEnabled());
1400 ReleaseTouchPoint(0); 1400 ReleaseTouchPoint(0);
1401 uint32_t touch_release_event_id3 = SendTouchEvent(); 1401 uint32_t touch_release_event_id3 = SendTouchEvent();
1402 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1402 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1403 touch_press_event_id3); 1403 touch_press_event_id3);
1404 SendTouchEventACK(WebInputEvent::kTouchEnd, INPUT_EVENT_ACK_STATE_CONSUMED, 1404 SendTouchEventACK(WebInputEvent::kTouchEnd, INPUT_EVENT_ACK_STATE_CONSUMED,
1405 touch_release_event_id3); 1405 touch_release_event_id3);
1406 1406
1407 // As the touch-action is reset by a new touch sequence, the timeout behavior 1407 // As the touch-action is reset by a new touch sequence, the timeout behavior
1408 // should be restored. 1408 // should be restored.
1409 PressTouchPoint(1, 1); 1409 PressTouchPoint(1, 1);
1410 SendTouchEvent(); 1410 SendTouchEvent();
1411 EXPECT_TRUE(TouchEventTimeoutEnabled()); 1411 EXPECT_TRUE(TouchEventTimeoutEnabled());
1412 } 1412 }
1413 1413
1414 // Test that a touch sequenced preceded by TOUCH_ACTION_NONE is not affected by 1414 // Test that a touch sequenced preceded by kTouchActionNone is not affected by
1415 // the touch timeout. 1415 // the touch timeout.
1416 TEST_F(InputRouterImplTest, 1416 TEST_F(InputRouterImplTest,
1417 TouchAckTimeoutDisabledForTouchSequenceAfterTouchActionNone) { 1417 TouchAckTimeoutDisabledForTouchSequenceAfterTouchActionNone) {
1418 const int kDesktopTimeoutMs = 1; 1418 const int kDesktopTimeoutMs = 1;
1419 const int kMobileTimeoutMs = 2; 1419 const int kMobileTimeoutMs = 2;
1420 SetUpForTouchAckTimeoutTest(kDesktopTimeoutMs, kMobileTimeoutMs); 1420 SetUpForTouchAckTimeoutTest(kDesktopTimeoutMs, kMobileTimeoutMs);
1421 ASSERT_TRUE(TouchEventTimeoutEnabled()); 1421 ASSERT_TRUE(TouchEventTimeoutEnabled());
1422 OnHasTouchEventHandlers(true); 1422 OnHasTouchEventHandlers(true);
1423 1423
1424 // Start a touch sequence. 1424 // Start a touch sequence.
1425 PressTouchPoint(1, 1); 1425 PressTouchPoint(1, 1);
1426 uint32_t touch_press_event_id = SendTouchEvent(); 1426 uint32_t touch_press_event_id = SendTouchEvent();
1427 EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); 1427 EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
1428 1428
1429 // TOUCH_ACTION_NONE should disable the timeout. 1429 // kTouchActionNone should disable the timeout.
1430 OnSetTouchAction(TOUCH_ACTION_NONE); 1430 OnSetTouchAction(cc::kTouchActionNone);
1431 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1431 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1432 touch_press_event_id); 1432 touch_press_event_id);
1433 EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount()); 1433 EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
1434 EXPECT_FALSE(TouchEventTimeoutEnabled()); 1434 EXPECT_FALSE(TouchEventTimeoutEnabled());
1435 1435
1436 MoveTouchPoint(0, 1, 2); 1436 MoveTouchPoint(0, 1, 2);
1437 uint32_t touch_move_event_id = SendTouchEvent(); 1437 uint32_t touch_move_event_id = SendTouchEvent();
1438 EXPECT_FALSE(TouchEventTimeoutEnabled()); 1438 EXPECT_FALSE(TouchEventTimeoutEnabled());
1439 EXPECT_EQ(1U, GetSentMessageCountAndResetSink()); 1439 EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
1440 1440
(...skipping 27 matching lines...) Expand all
1468 } 1468 }
1469 1469
1470 // Test that TouchActionFilter::ResetTouchAction is called before the 1470 // Test that TouchActionFilter::ResetTouchAction is called before the
1471 // first touch event for a touch sequence reaches the renderer. 1471 // first touch event for a touch sequence reaches the renderer.
1472 TEST_F(InputRouterImplTest, TouchActionResetBeforeEventReachesRenderer) { 1472 TEST_F(InputRouterImplTest, TouchActionResetBeforeEventReachesRenderer) {
1473 OnHasTouchEventHandlers(true); 1473 OnHasTouchEventHandlers(true);
1474 1474
1475 // Sequence 1. 1475 // Sequence 1.
1476 PressTouchPoint(1, 1); 1476 PressTouchPoint(1, 1);
1477 uint32_t touch_press_event_id1 = SendTouchEvent(); 1477 uint32_t touch_press_event_id1 = SendTouchEvent();
1478 OnSetTouchAction(TOUCH_ACTION_NONE); 1478 OnSetTouchAction(cc::kTouchActionNone);
1479 MoveTouchPoint(0, 50, 50); 1479 MoveTouchPoint(0, 50, 50);
1480 uint32_t touch_move_event_id1 = SendTouchEvent(); 1480 uint32_t touch_move_event_id1 = SendTouchEvent();
1481 ReleaseTouchPoint(0); 1481 ReleaseTouchPoint(0);
1482 uint32_t touch_release_event_id1 = SendTouchEvent(); 1482 uint32_t touch_release_event_id1 = SendTouchEvent();
1483 1483
1484 // Sequence 2. 1484 // Sequence 2.
1485 PressTouchPoint(1, 1); 1485 PressTouchPoint(1, 1);
1486 uint32_t touch_press_event_id2 = SendTouchEvent(); 1486 uint32_t touch_press_event_id2 = SendTouchEvent();
1487 MoveTouchPoint(0, 50, 50); 1487 MoveTouchPoint(0, 50, 50);
1488 uint32_t touch_move_event_id2 = SendTouchEvent(); 1488 uint32_t touch_move_event_id2 = SendTouchEvent();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 // Test that TouchActionFilter::ResetTouchAction is called when a new touch 1528 // Test that TouchActionFilter::ResetTouchAction is called when a new touch
1529 // sequence has no consumer. 1529 // sequence has no consumer.
1530 TEST_F(InputRouterImplTest, TouchActionResetWhenTouchHasNoConsumer) { 1530 TEST_F(InputRouterImplTest, TouchActionResetWhenTouchHasNoConsumer) {
1531 OnHasTouchEventHandlers(true); 1531 OnHasTouchEventHandlers(true);
1532 1532
1533 // Sequence 1. 1533 // Sequence 1.
1534 PressTouchPoint(1, 1); 1534 PressTouchPoint(1, 1);
1535 uint32_t touch_press_event_id1 = SendTouchEvent(); 1535 uint32_t touch_press_event_id1 = SendTouchEvent();
1536 MoveTouchPoint(0, 50, 50); 1536 MoveTouchPoint(0, 50, 50);
1537 uint32_t touch_move_event_id1 = SendTouchEvent(); 1537 uint32_t touch_move_event_id1 = SendTouchEvent();
1538 OnSetTouchAction(TOUCH_ACTION_NONE); 1538 OnSetTouchAction(cc::kTouchActionNone);
1539 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1539 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1540 touch_press_event_id1); 1540 touch_press_event_id1);
1541 SendTouchEventACK(WebInputEvent::kTouchMove, INPUT_EVENT_ACK_STATE_CONSUMED, 1541 SendTouchEventACK(WebInputEvent::kTouchMove, INPUT_EVENT_ACK_STATE_CONSUMED,
1542 touch_move_event_id1); 1542 touch_move_event_id1);
1543 1543
1544 ReleaseTouchPoint(0); 1544 ReleaseTouchPoint(0);
1545 uint32_t touch_release_event_id1 = SendTouchEvent(); 1545 uint32_t touch_release_event_id1 = SendTouchEvent();
1546 1546
1547 // Sequence 2 1547 // Sequence 2
1548 PressTouchPoint(1, 1); 1548 PressTouchPoint(1, 1);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 1580
1581 // Test that TouchActionFilter::ResetTouchAction is called when the touch 1581 // Test that TouchActionFilter::ResetTouchAction is called when the touch
1582 // handler is removed. 1582 // handler is removed.
1583 TEST_F(InputRouterImplTest, TouchActionResetWhenTouchHandlerRemoved) { 1583 TEST_F(InputRouterImplTest, TouchActionResetWhenTouchHandlerRemoved) {
1584 // Touch sequence with touch handler. 1584 // Touch sequence with touch handler.
1585 OnHasTouchEventHandlers(true); 1585 OnHasTouchEventHandlers(true);
1586 PressTouchPoint(1, 1); 1586 PressTouchPoint(1, 1);
1587 uint32_t touch_press_event_id = SendTouchEvent(); 1587 uint32_t touch_press_event_id = SendTouchEvent();
1588 MoveTouchPoint(0, 50, 50); 1588 MoveTouchPoint(0, 50, 50);
1589 uint32_t touch_move_event_id = SendTouchEvent(); 1589 uint32_t touch_move_event_id = SendTouchEvent();
1590 OnSetTouchAction(TOUCH_ACTION_NONE); 1590 OnSetTouchAction(cc::kTouchActionNone);
1591 ReleaseTouchPoint(0); 1591 ReleaseTouchPoint(0);
1592 uint32_t touch_release_event_id = SendTouchEvent(); 1592 uint32_t touch_release_event_id = SendTouchEvent();
1593 EXPECT_EQ(3U, GetSentMessageCountAndResetSink()); 1593 EXPECT_EQ(3U, GetSentMessageCountAndResetSink());
1594 1594
1595 // Ensure we have touch-action:none, suppressing scroll events. 1595 // Ensure we have touch-action:none, suppressing scroll events.
1596 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1596 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1597 touch_press_event_id); 1597 touch_press_event_id);
1598 EXPECT_EQ(0U, GetSentMessageCountAndResetSink()); 1598 EXPECT_EQ(0U, GetSentMessageCountAndResetSink());
1599 SendTouchEventACK(WebInputEvent::kTouchMove, 1599 SendTouchEventACK(WebInputEvent::kTouchMove,
1600 INPUT_EVENT_ACK_STATE_NOT_CONSUMED, touch_move_event_id); 1600 INPUT_EVENT_ACK_STATE_NOT_CONSUMED, touch_move_event_id);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 } 1654 }
1655 1655
1656 // Test that the double tap gesture depends on the touch action of the first 1656 // Test that the double tap gesture depends on the touch action of the first
1657 // tap. 1657 // tap.
1658 TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) { 1658 TEST_F(InputRouterImplTest, DoubleTapGestureDependsOnFirstTap) {
1659 OnHasTouchEventHandlers(true); 1659 OnHasTouchEventHandlers(true);
1660 1660
1661 // Sequence 1. 1661 // Sequence 1.
1662 PressTouchPoint(1, 1); 1662 PressTouchPoint(1, 1);
1663 uint32_t touch_press_event_id1 = SendTouchEvent(); 1663 uint32_t touch_press_event_id1 = SendTouchEvent();
1664 OnSetTouchAction(TOUCH_ACTION_NONE); 1664 OnSetTouchAction(cc::kTouchActionNone);
1665 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1665 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1666 touch_press_event_id1); 1666 touch_press_event_id1);
1667 1667
1668 ReleaseTouchPoint(0); 1668 ReleaseTouchPoint(0);
1669 uint32_t touch_release_event_id = SendTouchEvent(); 1669 uint32_t touch_release_event_id = SendTouchEvent();
1670 1670
1671 // Sequence 2 1671 // Sequence 2
1672 PressTouchPoint(1, 1); 1672 PressTouchPoint(1, 1);
1673 uint32_t touch_press_event_id2 = SendTouchEvent(); 1673 uint32_t touch_press_event_id2 = SendTouchEvent();
1674 1674
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 1722
1723 // Test that the double tap gesture depends on the touch action of the first 1723 // Test that the double tap gesture depends on the touch action of the first
1724 // tap. 1724 // tap.
1725 TEST_F(InputRouterImplRafAlignedTouchDisabledTest, 1725 TEST_F(InputRouterImplRafAlignedTouchDisabledTest,
1726 DoubleTapGestureDependsOnFirstTap) { 1726 DoubleTapGestureDependsOnFirstTap) {
1727 OnHasTouchEventHandlers(true); 1727 OnHasTouchEventHandlers(true);
1728 1728
1729 // Sequence 1. 1729 // Sequence 1.
1730 PressTouchPoint(1, 1); 1730 PressTouchPoint(1, 1);
1731 uint32_t touch_press_event_id1 = SendTouchEvent(); 1731 uint32_t touch_press_event_id1 = SendTouchEvent();
1732 OnSetTouchAction(TOUCH_ACTION_NONE); 1732 OnSetTouchAction(cc::kTouchActionNone);
1733 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1733 SendTouchEventACK(WebInputEvent::kTouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1734 touch_press_event_id1); 1734 touch_press_event_id1);
1735 1735
1736 ReleaseTouchPoint(0); 1736 ReleaseTouchPoint(0);
1737 uint32_t touch_release_event_id = SendTouchEvent(); 1737 uint32_t touch_release_event_id = SendTouchEvent();
1738 1738
1739 // Sequence 2 1739 // Sequence 2
1740 PressTouchPoint(1, 1); 1740 PressTouchPoint(1, 1);
1741 uint32_t touch_press_event_id2 = SendTouchEvent(); 1741 uint32_t touch_press_event_id2 = SendTouchEvent();
1742 1742
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
2500 EXPECT_EQ(80, sent_event->data.fling_start.velocity_y); 2500 EXPECT_EQ(80, sent_event->data.fling_start.velocity_y);
2501 2501
2502 const WebGestureEvent* filter_event = 2502 const WebGestureEvent* filter_event =
2503 GetFilterWebInputEvent<WebGestureEvent>(); 2503 GetFilterWebInputEvent<WebGestureEvent>();
2504 TestLocationInFilterEvent(filter_event, orig); 2504 TestLocationInFilterEvent(filter_event, orig);
2505 EXPECT_EQ(30, filter_event->data.fling_start.velocity_x); 2505 EXPECT_EQ(30, filter_event->data.fling_start.velocity_x);
2506 EXPECT_EQ(40, filter_event->data.fling_start.velocity_y); 2506 EXPECT_EQ(40, filter_event->data.fling_start.velocity_y);
2507 } 2507 }
2508 2508
2509 } // namespace content 2509 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.cc ('k') | content/browser/renderer_host/input/touch_action_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698