step_count_(0) {
*finished_ = false;
}
- virtual ~MockSyntheticGesture() {}
+ ~MockSyntheticGesture() override {}
- virtual Result ForwardInputEvents(const base::TimeTicks& timestamp,
- SyntheticGestureTarget* target) OVERRIDE {
+ Result ForwardInputEvents(const base::TimeTicks& timestamp,
+ SyntheticGestureTarget* target) override {
step_count_++;
if (step_count_ == num_steps_) {
*finished_ = true;
MockSyntheticGestureTarget()
: flush_requested_(false),
pointer_assumed_stopped_time_ms_(kPointerAssumedStoppedTimeMs) {}
- virtual ~MockSyntheticGestureTarget() {}
+ ~MockSyntheticGestureTarget() override {}
// SyntheticGestureTarget:
- virtual void DispatchInputEventToPlatform(
- const WebInputEvent& event) OVERRIDE {}
+ void DispatchInputEventToPlatform(const WebInputEvent& event) override {}
- virtual void SetNeedsFlush() OVERRIDE {
- flush_requested_ = true;
- }
+ void SetNeedsFlush() override { flush_requested_ = true; }
- virtual SyntheticGestureParams::GestureSourceType
- GetDefaultSyntheticGestureSourceType() const OVERRIDE {
+ SyntheticGestureParams::GestureSourceType
+ GetDefaultSyntheticGestureSourceType() const override {
return SyntheticGestureParams::TOUCH_INPUT;
}
- virtual base::TimeDelta PointerAssumedStoppedTime() const OVERRIDE {
+ base::TimeDelta PointerAssumedStoppedTime() const override {
return base::TimeDelta::FromMilliseconds(pointer_assumed_stopped_time_ms_);
}
pointer_assumed_stopped_time_ms_ = time_ms;
}
- virtual float GetTouchSlopInDips() const OVERRIDE {
- return kTouchSlopInDips;
- }
+ float GetTouchSlopInDips() const override { return kTouchSlopInDips; }
- virtual float GetMinScalingSpanInDips() const OVERRIDE {
+ float GetMinScalingSpanInDips() const override {
return kMinScalingSpanInDips;
}
class MockScrollGestureTarget : public MockSyntheticGestureTarget {
public:
MockScrollGestureTarget() : total_abs_scroll_distance_length_(0) {}
- virtual ~MockScrollGestureTarget() {}
+ ~MockScrollGestureTarget() override {}
gfx::Vector2dF start_to_end_distance() const {
return start_to_end_distance_;
class MockScrollMouseTarget : public MockScrollGestureTarget {
public:
MockScrollMouseTarget() {}
- virtual ~MockScrollMouseTarget() {}
+ ~MockScrollMouseTarget() override {}
- virtual void DispatchInputEventToPlatform(
- const WebInputEvent& event) OVERRIDE {
+ void DispatchInputEventToPlatform(const WebInputEvent& event) override {
ASSERT_EQ(event.type, WebInputEvent::MouseWheel);
const WebMouseWheelEvent& mouse_wheel_event =
static_cast<const WebMouseWheelEvent&>(event);
class MockScrollTouchTarget : public MockScrollGestureTarget {
public:
MockScrollTouchTarget() : started_(false) {}
- virtual ~MockScrollTouchTarget() {}
+ ~MockScrollTouchTarget() override {}
- virtual void DispatchInputEventToPlatform(
- const WebInputEvent& event) OVERRIDE {
+ void DispatchInputEventToPlatform(const WebInputEvent& event) override {
ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type));
const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event);
ASSERT_EQ(touch_event.touchesLength, 1U);
last_pointer_distance_(0),
zoom_direction_(ZOOM_DIRECTION_UNKNOWN),
started_(false) {}
- virtual ~MockSyntheticPinchTouchTarget() {}
+ ~MockSyntheticPinchTouchTarget() override {}
- virtual void DispatchInputEventToPlatform(
- const WebInputEvent& event) OVERRIDE {
+ void DispatchInputEventToPlatform(const WebInputEvent& event) override {
ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type));
const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event);
ASSERT_EQ(touch_event.touchesLength, 2U);
class MockSyntheticTapGestureTarget : public MockSyntheticGestureTarget {
public:
MockSyntheticTapGestureTarget() : state_(NOT_STARTED) {}
- virtual ~MockSyntheticTapGestureTarget() {}
+ ~MockSyntheticTapGestureTarget() override {}
bool GestureFinished() const { return state_ == FINISHED; }
gfx::PointF position() const { return position_; }
class MockSyntheticTapTouchTarget : public MockSyntheticTapGestureTarget {
public:
MockSyntheticTapTouchTarget() {}
- virtual ~MockSyntheticTapTouchTarget() {}
+ ~MockSyntheticTapTouchTarget() override {}
- virtual void DispatchInputEventToPlatform(
- const WebInputEvent& event) OVERRIDE {
+ void DispatchInputEventToPlatform(const WebInputEvent& event) override {
ASSERT_TRUE(WebInputEvent::isTouchEventType(event.type));
const WebTouchEvent& touch_event = static_cast<const WebTouchEvent&>(event);
ASSERT_EQ(touch_event.touchesLength, 1U);
class MockSyntheticTapMouseTarget : public MockSyntheticTapGestureTarget {
public:
MockSyntheticTapMouseTarget() {}
- virtual ~MockSyntheticTapMouseTarget() {}
+ ~MockSyntheticTapMouseTarget() override {}
- virtual void DispatchInputEventToPlatform(
- const WebInputEvent& event) OVERRIDE {
+ void DispatchInputEventToPlatform(const WebInputEvent& event) override {
ASSERT_TRUE(WebInputEvent::isMouseEventType(event.type));
const WebMouseEvent& mouse_event = static_cast<const WebMouseEvent&>(event);
class SyntheticGestureControllerTest : public testing::Test {
public:
SyntheticGestureControllerTest() {}
- virtual ~SyntheticGestureControllerTest() {}
+ ~SyntheticGestureControllerTest() override {}
protected:
template<typename MockGestureTarget>
scoped_ptr<SyntheticGestureTarget>(target_)));
}
- virtual void SetUp() OVERRIDE {
+ void SetUp() override {
start_time_ = base::TimeTicks::Now();
time_ = start_time_;
num_success_ = 0;
num_failure_ = 0;
}
- virtual void TearDown() OVERRIDE {
+ void TearDown() override {
controller_.reset();
target_ = NULL;
time_ = base::TimeTicks();
bool finished = false;
scoped_ptr<MockSyntheticGesture> gesture(
new MockSyntheticGesture(&finished, 3));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
EXPECT_TRUE(finished);
bool finished = false;
scoped_ptr<MockSyntheticGesture> gesture(
new MockSyntheticGesture(&finished, 0));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
EXPECT_TRUE(finished);
new MockSyntheticGesture(&finished_2, 4));
// Queue first gesture and wait for it to finish
- QueueSyntheticGesture(gesture_1.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture_1.Pass());
FlushInputUntilComplete();
EXPECT_TRUE(finished_1);
EXPECT_EQ(0, num_failure_);
// Queue second gesture.
- QueueSyntheticGesture(gesture_2.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture_2.Pass());
FlushInputUntilComplete();
EXPECT_TRUE(finished_2);
scoped_ptr<MockSyntheticGesture> gesture_2(
new MockSyntheticGesture(&finished_2, 4));
- QueueSyntheticGesture(gesture_1.PassAs<SyntheticGesture>());
- QueueSyntheticGesture(gesture_2.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture_1.Pass());
+ QueueSyntheticGesture(gesture_2.Pass());
FlushInputUntilComplete();
EXPECT_TRUE(finished_1);
scoped_ptr<MockSyntheticGesture> gesture_2(
new MockSyntheticGesture(&finished_2, 4));
- QueueSyntheticGesture(gesture_1.PassAs<SyntheticGesture>());
- QueueSyntheticGesture(gesture_2.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture_1.Pass());
+ QueueSyntheticGesture(gesture_2.Pass());
while (target_->flush_requested()) {
target_->ClearFlushRequest();
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
scoped_ptr<SyntheticSmoothScrollGesture> gesture(
new SyntheticSmoothScrollGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockScrollGestureTarget* scroll_target =
params.anchor.SetPoint(54, 89);
scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockSyntheticPinchTouchTarget* pinch_target =
params.anchor.SetPoint(-12, 93);
scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockSyntheticPinchTouchTarget* pinch_target =
params.scale_factor = 1.0f;
scoped_ptr<SyntheticPinchGesture> gesture(new SyntheticPinchGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockSyntheticPinchTouchTarget* pinch_target =
params.position.SetPoint(87, -124);
scoped_ptr<SyntheticTapGesture> gesture(new SyntheticTapGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockSyntheticTapTouchTarget* tap_target =
params.position.SetPoint(98, 123);
scoped_ptr<SyntheticTapGesture> gesture(new SyntheticTapGesture(params));
- QueueSyntheticGesture(gesture.PassAs<SyntheticGesture>());
+ QueueSyntheticGesture(gesture.Pass());
FlushInputUntilComplete();
MockSyntheticTapMouseTarget* tap_target =