Commit 80edc0c2 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

[Code cleanup] Remove num_of_active_touches_for_test function

We have num_of_active_touches_for_test in both TouchActionFilter and
InputRouterImpl class which are used in InputRouterImplTest only. This
CL makes InputRouterImplTest a friend class to TouchActionFilter so that
we can just access its private member.

This CL is a code cleanup, there is no behavior change introduced.

Bug: None
Change-Id: I768a5e293f5c16d1f1d39af7e2abf161f35e669d
Reviewed-on: https://chromium-review.googlesource.com/1246274Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Reviewed-by: default avatarNavid Zolghadr <nzolghadr@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595167}
parent a0549215
...@@ -110,9 +110,6 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter, ...@@ -110,9 +110,6 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter,
bool OnMessageReceived(const IPC::Message& message) override; bool OnMessageReceived(const IPC::Message& message) override;
void OnHasTouchEventHandlersForTest(bool has_handlers); void OnHasTouchEventHandlersForTest(bool has_handlers);
int num_of_active_touches_for_test() {
return touch_action_filter_.num_of_active_touches_for_test();
}
private: private:
friend class InputRouterImplTest; friend class InputRouterImplTest;
......
...@@ -433,11 +433,11 @@ class InputRouterImplTest : public testing::Test { ...@@ -433,11 +433,11 @@ class InputRouterImplTest : public testing::Test {
input_router_->TouchEventHandled( input_router_->TouchEventHandled(
TouchEventWithLatencyInfo(touch_event_), InputEventAckSource::BROWSER, TouchEventWithLatencyInfo(touch_event_), InputEventAckSource::BROWSER,
ui::LatencyInfo(), state, overscroll, touch_action); ui::LatencyInfo(), state, overscroll, touch_action);
EXPECT_EQ(input_router_->num_of_active_touches_for_test(), 1); EXPECT_EQ(input_router_->touch_action_filter_.num_of_active_touches_, 1);
ReleaseTouchPoint(0); ReleaseTouchPoint(0);
input_router_->OnTouchEventAck(TouchEventWithLatencyInfo(touch_event_), input_router_->OnTouchEventAck(TouchEventWithLatencyInfo(touch_event_),
InputEventAckSource::BROWSER, state); InputEventAckSource::BROWSER, state);
EXPECT_EQ(input_router_->num_of_active_touches_for_test(), 0); EXPECT_EQ(input_router_->touch_action_filter_.num_of_active_touches_, 0);
} }
void OnTouchEventAckWithAckState(InputEventAckState ack_state) { void OnTouchEventAckWithAckState(InputEventAckState ack_state) {
......
...@@ -68,12 +68,12 @@ class CONTENT_EXPORT TouchActionFilter { ...@@ -68,12 +68,12 @@ class CONTENT_EXPORT TouchActionFilter {
void IncreaseActiveTouches(); void IncreaseActiveTouches();
void DecreaseActiveTouches(); void DecreaseActiveTouches();
int num_of_active_touches_for_test() { return num_of_active_touches_; }
// Debugging only. // Debugging only.
void AppendToGestureSequenceForDebugging(const char* str); void AppendToGestureSequenceForDebugging(const char* str);
private: private:
friend class InputRouterImplTest;
friend class MockRenderWidgetHost; friend class MockRenderWidgetHost;
friend class TouchActionFilterTest; friend class TouchActionFilterTest;
friend class SitePerProcessBrowserTouchActionTest; friend class SitePerProcessBrowserTouchActionTest;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment