| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 return MockMotionEvent(); | 116 return MockMotionEvent(); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 static MockMotionEvent ObtainMotionEvent(base::TimeTicks event_time, | 120 static MockMotionEvent ObtainMotionEvent(base::TimeTicks event_time, |
| 121 MotionEvent::Action action) { | 121 MotionEvent::Action action) { |
| 122 return ObtainMotionEvent(event_time, action, kFakeCoordX, kFakeCoordY); | 122 return ObtainMotionEvent(event_time, action, kFakeCoordX, kFakeCoordY); |
| 123 } | 123 } |
| 124 | 124 |
| 125 // Test | 125 // Test |
| 126 virtual void SetUp() OVERRIDE { SetUpWithConfig(GetDefaultConfig()); } | 126 virtual void SetUp() override { SetUpWithConfig(GetDefaultConfig()); } |
| 127 | 127 |
| 128 virtual void TearDown() OVERRIDE { | 128 virtual void TearDown() override { |
| 129 gestures_.clear(); | 129 gestures_.clear(); |
| 130 gesture_provider_.reset(); | 130 gesture_provider_.reset(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // GestureProviderClient | 133 // GestureProviderClient |
| 134 virtual void OnGestureEvent(const GestureEventData& gesture) OVERRIDE { | 134 virtual void OnGestureEvent(const GestureEventData& gesture) override { |
| 135 if (gesture.type() == ET_GESTURE_SCROLL_BEGIN) | 135 if (gesture.type() == ET_GESTURE_SCROLL_BEGIN) |
| 136 active_scroll_begin_event_.reset(new GestureEventData(gesture)); | 136 active_scroll_begin_event_.reset(new GestureEventData(gesture)); |
| 137 gestures_.push_back(gesture); | 137 gestures_.push_back(gesture); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void SetUpWithConfig(const GestureProvider::Config& config) { | 140 void SetUpWithConfig(const GestureProvider::Config& config) { |
| 141 gesture_provider_.reset(new GestureProvider(config, this)); | 141 gesture_provider_.reset(new GestureProvider(config, this)); |
| 142 gesture_provider_->SetMultiTouchZoomSupportEnabled(false); | 142 gesture_provider_->SetMultiTouchZoomSupportEnabled(false); |
| 143 } | 143 } |
| 144 | 144 |
| (...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2493 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); | 2493 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); |
| 2494 EXPECT_EQ(ET_GESTURE_TAP, GetMostRecentGestureEventType()); | 2494 EXPECT_EQ(ET_GESTURE_TAP, GetMostRecentGestureEventType()); |
| 2495 | 2495 |
| 2496 EXPECT_EQ(1, GetMostRecentGestureEvent().details.tap_count()); | 2496 EXPECT_EQ(1, GetMostRecentGestureEvent().details.tap_count()); |
| 2497 EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); | 2497 EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); |
| 2498 EXPECT_EQ(gfx::RectF(0, 0, 20, 20), | 2498 EXPECT_EQ(gfx::RectF(0, 0, 20, 20), |
| 2499 GetMostRecentGestureEvent().details.bounding_box()); | 2499 GetMostRecentGestureEvent().details.bounding_box()); |
| 2500 } | 2500 } |
| 2501 | 2501 |
| 2502 } // namespace ui | 2502 } // namespace ui |
| OLD | NEW |