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

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

Issue 2173073003: Move WebInputEvent into public/platform from public/web (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gn build failure with android Created 4 years, 5 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698