| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/time/time.h" | 6 #include "base/time/time.h" |
| 7 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 7 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 8 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 8 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
| 9 #include "content/browser/renderer_host/input/synthetic_pointer_action.h" | 9 #include "content/browser/renderer_host/input/synthetic_pointer_action.h" |
| 10 #include "content/browser/renderer_host/input/synthetic_touch_pointer.h" | 10 #include "content/browser/renderer_host/input/synthetic_touch_pointer.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 GetDefaultSyntheticGestureSourceType() const override { | 72 GetDefaultSyntheticGestureSourceType() const override { |
| 73 return SyntheticGestureParams::TOUCH_INPUT; | 73 return SyntheticGestureParams::TOUCH_INPUT; |
| 74 } | 74 } |
| 75 | 75 |
| 76 gfx::PointF positions(int index) const { return positions_[index]; } | 76 gfx::PointF positions(int index) const { return positions_[index]; } |
| 77 int indexes(int index) const { return indexes_[index]; } | 77 int indexes(int index) const { return indexes_[index]; } |
| 78 WebTouchPoint::State states(int index) { return states_[index]; } | 78 WebTouchPoint::State states(int index) { return states_[index]; } |
| 79 unsigned touch_length() const { return touch_length_; } | 79 unsigned touch_length() const { return touch_length_; } |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 gfx::PointF positions_[WebTouchEvent::touchesLengthCap]; | 82 gfx::PointF positions_[WebTouchEvent::kTouchesLengthCap]; |
| 83 unsigned touch_length_; | 83 unsigned touch_length_; |
| 84 int indexes_[WebTouchEvent::touchesLengthCap]; | 84 int indexes_[WebTouchEvent::kTouchesLengthCap]; |
| 85 WebTouchPoint::State states_[WebTouchEvent::touchesLengthCap]; | 85 WebTouchPoint::State states_[WebTouchEvent::kTouchesLengthCap]; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 class SyntheticPointerActionTest : public testing::Test { | 88 class SyntheticPointerActionTest : public testing::Test { |
| 89 public: | 89 public: |
| 90 SyntheticPointerActionTest() { | 90 SyntheticPointerActionTest() { |
| 91 target_.reset(new MockSyntheticPointerTouchActionTarget()); | 91 target_.reset(new MockSyntheticPointerTouchActionTarget()); |
| 92 synthetic_pointer_ = | 92 synthetic_pointer_ = |
| 93 SyntheticPointer::Create(SyntheticGestureParams::TOUCH_INPUT); | 93 SyntheticPointer::Create(SyntheticGestureParams::TOUCH_INPUT); |
| 94 action_param_list_.reset(new std::vector<SyntheticPointerActionParams>()); | 94 action_param_list_.reset(new std::vector<SyntheticPointerActionParams>()); |
| 95 std::fill(index_map_.begin(), index_map_.end(), -1); | 95 std::fill(index_map_.begin(), index_map_.end(), -1); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 action_param_list_->push_back(params0); | 324 action_param_list_->push_back(params0); |
| 325 ForwardSyntheticPointerAction(); | 325 ForwardSyntheticPointerAction(); |
| 326 | 326 |
| 327 EXPECT_EQ(1, num_success_); | 327 EXPECT_EQ(1, num_success_); |
| 328 EXPECT_EQ(3, num_failure_); | 328 EXPECT_EQ(3, num_failure_); |
| 329 } | 329 } |
| 330 | 330 |
| 331 } // namespace | 331 } // namespace |
| 332 | 332 |
| 333 } // namespace content | 333 } // namespace content |
| OLD | NEW |