Rename OnHasTouchEventHandlersForTest in InputRouterImpl

The call site of this function is resetting the |allowed_touch_action_|
only, so rename this function to ForceResetTouchActionForTest.

This CL should not introduce any behavior change.

Bug: None
Change-Id: I253d73f4f21bdb6268f43ce535453412f4b32c51
Reviewed-on: https://chromium-review.googlesource.com/c/1277947
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: James MacLean <wjmaclean@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599184}
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index f72a8f5..899b712 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -590,9 +590,8 @@
   touch_action_filter_.OnSetTouchAction(cc::kTouchActionAuto);
 }
 
-void InputRouterImpl::OnHasTouchEventHandlersForTest(bool has_handlers) {
-  touch_action_filter_.OnHasTouchEventHandlers(has_handlers);
-  // TODO(ajwong): Why doesn't this change |touch_event_queue_|?
+void InputRouterImpl::ForceResetTouchActionForTest() {
+  touch_action_filter_.ForceResetTouchActionForTest();
 }
 
 void InputRouterImpl::OnSetTouchAction(cc::TouchAction touch_action) {
diff --git a/content/browser/renderer_host/input/input_router_impl.h b/content/browser/renderer_host/input/input_router_impl.h
index 3edcf79..0582b35 100644
--- a/content/browser/renderer_host/input/input_router_impl.h
+++ b/content/browser/renderer_host/input/input_router_impl.h
@@ -107,7 +107,7 @@
     return frame_host_binding_;
   }
 
-  void OnHasTouchEventHandlersForTest(bool has_handlers);
+  void ForceResetTouchActionForTest();
 
  private:
   friend class InputRouterImplTest;
diff --git a/content/browser/renderer_host/input/touch_action_filter.cc b/content/browser/renderer_host/input/touch_action_filter.cc
index 249640d..da66a5d 100644
--- a/content/browser/renderer_host/input/touch_action_filter.cc
+++ b/content/browser/renderer_host/input/touch_action_filter.cc
@@ -231,6 +231,11 @@
   return false;
 }
 
+void TouchActionFilter::ForceResetTouchActionForTest() {
+  allowed_touch_action_.reset();
+  scrolling_touch_action_.reset();
+}
+
 void TouchActionFilter::OnSetTouchAction(cc::TouchAction touch_action) {
   // TODO(https://crbug.com/849819): add a DCHECK for
   // |has_touch_event_handler_|.
diff --git a/content/browser/renderer_host/input/touch_action_filter.h b/content/browser/renderer_host/input/touch_action_filter.h
index 0def2d9..231a026 100644
--- a/content/browser/renderer_host/input/touch_action_filter.h
+++ b/content/browser/renderer_host/input/touch_action_filter.h
@@ -69,6 +69,8 @@
   void IncreaseActiveTouches();
   void DecreaseActiveTouches();
 
+  void ForceResetTouchActionForTest();
+
   // Debugging only.
   void AppendToGestureSequenceForDebugging(const char* str);
 
diff --git a/content/browser/site_per_process_hit_test_browsertest.cc b/content/browser/site_per_process_hit_test_browsertest.cc
index 71f632e6..8ff295b6 100644
--- a/content/browser/site_per_process_hit_test_browsertest.cc
+++ b/content/browser/site_per_process_hit_test_browsertest.cc
@@ -4788,7 +4788,7 @@
       static_cast<InputRouterImpl*>(
           static_cast<RenderWidgetHostImpl*>(rwhva_root_->GetRenderWidgetHost())
               ->input_router())
-          ->OnHasTouchEventHandlersForTest(true);
+          ->ForceResetTouchActionForTest();
     }
     SendPinchBeginEndSequence(rwhva_root_, bounds.CenterPoint(), rwhi_child_);
 
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 932bb243..6860439 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -653,7 +653,7 @@
 void ResetTouchAction(RenderWidgetHost* host) {
   static_cast<InputRouterImpl*>(
       static_cast<RenderWidgetHostImpl*>(host)->input_router())
-      ->OnHasTouchEventHandlersForTest(true);
+      ->ForceResetTouchActionForTest();
 }
 
 void ResendGestureScrollUpdateToEmbedder(WebContents* guest_web_contents,