OLD | NEW |
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/touch_event_queue.h" | 5 #include "content/browser/renderer_host/input/touch_event_queue.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 EXPECT_EQ(WebInputEvent::TouchEnd, acked_event().type); | 2707 EXPECT_EQ(WebInputEvent::TouchEnd, acked_event().type); |
2708 EXPECT_EQ(0U, queued_event_count()); | 2708 EXPECT_EQ(0U, queued_event_count()); |
2709 | 2709 |
2710 EXPECT_EQ(WebInputEvent::TouchStart, all_sent_events()[0].type); | 2710 EXPECT_EQ(WebInputEvent::TouchStart, all_sent_events()[0].type); |
2711 EXPECT_EQ(WebInputEvent::TouchScrollStarted, all_sent_events()[1].type); | 2711 EXPECT_EQ(WebInputEvent::TouchScrollStarted, all_sent_events()[1].type); |
2712 EXPECT_EQ(WebInputEvent::TouchMove, all_sent_events()[2].type); | 2712 EXPECT_EQ(WebInputEvent::TouchMove, all_sent_events()[2].type); |
2713 EXPECT_EQ(WebInputEvent::TouchEnd, all_sent_events()[3].type); | 2713 EXPECT_EQ(WebInputEvent::TouchEnd, all_sent_events()[3].type); |
2714 EXPECT_EQ(4U, GetAndResetSentEventCount()); | 2714 EXPECT_EQ(4U, GetAndResetSentEventCount()); |
2715 } | 2715 } |
2716 | 2716 |
| 2717 // Tests that if touchStartOrFirstTouchMove is correctly set up for touch |
| 2718 // events. |
| 2719 TEST_F(TouchEventQueueTest, TouchStartOrFirstTouchMove) { |
| 2720 PressTouchPoint(1, 1); |
| 2721 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 2722 EXPECT_EQ(WebInputEvent::TouchStart, sent_event().type); |
| 2723 EXPECT_TRUE(sent_event().touchStartOrFirstTouchMove); |
| 2724 |
| 2725 MoveTouchPoint(0, 5, 5); |
| 2726 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 2727 EXPECT_EQ(WebInputEvent::TouchMove, sent_event().type); |
| 2728 EXPECT_TRUE(sent_event().touchStartOrFirstTouchMove); |
| 2729 |
| 2730 MoveTouchPoint(0, 15, 15); |
| 2731 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 2732 EXPECT_EQ(WebInputEvent::TouchMove, sent_event().type); |
| 2733 EXPECT_FALSE(sent_event().touchStartOrFirstTouchMove); |
| 2734 |
| 2735 ReleaseTouchPoint(0); |
| 2736 SendTouchEventAck(INPUT_EVENT_ACK_STATE_CONSUMED); |
| 2737 EXPECT_EQ(WebInputEvent::TouchEnd, sent_event().type); |
| 2738 EXPECT_FALSE(sent_event().touchStartOrFirstTouchMove); |
| 2739 } |
| 2740 |
2717 } // namespace content | 2741 } // namespace content |
OLD | NEW |