| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return true; | 103 return true; |
| 104 } | 104 } |
| 105 return false; | 105 return false; |
| 106 } | 106 } |
| 107 | 107 |
| 108 const GestureEventData& GetMostRecentGestureEvent() const { | 108 const GestureEventData& GetMostRecentGestureEvent() const { |
| 109 EXPECT_FALSE(gestures_.empty()); | 109 EXPECT_FALSE(gestures_.empty()); |
| 110 return gestures_.back(); | 110 return gestures_.back(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 const EventType GetMostRecentGestureEventType() const { | 113 EventType GetMostRecentGestureEventType() const { |
| 114 EXPECT_FALSE(gestures_.empty()); | 114 EXPECT_FALSE(gestures_.empty()); |
| 115 return gestures_.back().type; | 115 return gestures_.back().type; |
| 116 } | 116 } |
| 117 | 117 |
| 118 size_t GetReceivedGestureCount() const { return gestures_.size(); } | 118 size_t GetReceivedGestureCount() const { return gestures_.size(); } |
| 119 | 119 |
| 120 const GestureEventData& GetReceivedGesture(size_t index) const { | 120 const GestureEventData& GetReceivedGesture(size_t index) const { |
| 121 EXPECT_LT(index, GetReceivedGestureCount()); | 121 EXPECT_LT(index, GetReceivedGestureCount()); |
| 122 return gestures_[index]; | 122 return gestures_[index]; |
| 123 } | 123 } |
| (...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 | 1455 |
| 1456 event = ObtainMotionEvent(event_time, MotionEvent::ACTION_CANCEL); | 1456 event = ObtainMotionEvent(event_time, MotionEvent::ACTION_CANCEL); |
| 1457 event.pointer_count = 1; | 1457 event.pointer_count = 1; |
| 1458 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 1458 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 1459 EXPECT_EQ(ET_GESTURE_END, GetMostRecentGestureEventType()); | 1459 EXPECT_EQ(ET_GESTURE_END, GetMostRecentGestureEventType()); |
| 1460 EXPECT_EQ(12U, GetReceivedGestureCount()); | 1460 EXPECT_EQ(12U, GetReceivedGestureCount()); |
| 1461 EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); | 1461 EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); |
| 1462 } | 1462 } |
| 1463 | 1463 |
| 1464 } // namespace ui | 1464 } // namespace ui |
| OLD | NEW |