Remove unused functions in TestRenderFrameHost

This CL removes functions from TestRenderFrameHost that ar no longer
used. It also removes one function from the public
RenderFrameHostTester interface that is no longer used outside of
content/.

Bug: 728571
Change-Id: I62cadcacc3e4d1ed7b0ca6d1c9ee46cd675a32bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1581960
Auto-Submit: Camille Lamy <clamy@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653958}
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h
index 878dac4..90b950d 100644
--- a/content/public/test/test_renderer_host.h
+++ b/content/public/test/test_renderer_host.h
@@ -92,22 +92,6 @@
   // Simulates a navigation stopping in the RenderFrameHost.
   virtual void SimulateNavigationStop() = 0;
 
-  // Calls DidCommitProvisionalLoad on the RenderFrameHost with the given
-  // information with various sets of parameters. These are helper functions for
-  // simulating the most common types of loads.
-  //
-  // Guidance for calling this:
-  // - nav_entry_id should be 0 if simulating a renderer-initiated navigation;
-  //   if simulating a browser-initiated one, pass the GetUniqueID() value of
-  //   the NavigationController's PendingEntry.
-  // - did_create_new_entry should be true if simulating a navigation that
-  //   created a new navigation entry; false for history navigations, reloads,
-  //   and other navigations that don't affect the history list.
-  virtual void SendNavigateWithTransition(int nav_entry_id,
-                                          bool did_create_new_entry,
-                                          const GURL& url,
-                                          ui::PageTransition transition) = 0;
-
   // Calls OnBeforeUnloadACK on this RenderFrameHost with the given parameter.
   virtual void SendBeforeUnloadACK(bool proceed) = 0;
 
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index bfd6089..71c67e1 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -231,8 +231,7 @@
                                        bool did_create_new_entry,
                                        const GURL& url) {
   SendNavigateWithParameters(nav_entry_id, did_create_new_entry, url,
-                             ui::PAGE_TRANSITION_LINK, 200,
-                             ModificationCallback());
+                             ui::PAGE_TRANSITION_LINK, 200);
 }
 
 void TestRenderFrameHost::SendNavigateWithTransition(
@@ -241,16 +240,7 @@
     const GURL& url,
     ui::PageTransition transition) {
   SendNavigateWithParameters(nav_entry_id, did_create_new_entry, url,
-                             transition, 200, ModificationCallback());
-}
-
-void TestRenderFrameHost::SendNavigateWithModificationCallback(
-    int nav_entry_id,
-    bool did_create_new_entry,
-    const GURL& url,
-    const ModificationCallback& callback) {
-  SendNavigateWithParameters(nav_entry_id, did_create_new_entry, url,
-                             ui::PAGE_TRANSITION_LINK, 200, callback);
+                             transition, 200);
 }
 
 void TestRenderFrameHost::SendNavigateWithParameters(
@@ -258,8 +248,7 @@
     bool did_create_new_entry,
     const GURL& url,
     ui::PageTransition transition,
-    int response_code,
-    const ModificationCallback& callback) {
+    int response_code) {
   // This approach to determining whether a navigation is to be treated as
   // same document is not robust, as it will not handle pushState type
   // navigation. Do not use elsewhere!
@@ -275,9 +264,6 @@
   auto params = BuildDidCommitParams(nav_entry_id, did_create_new_entry, url,
                                      transition, response_code);
 
-  if (!callback.is_null())
-    callback.Run(params.get());
-
   SendNavigateWithParams(params.get(), was_within_same_document);
 }
 
@@ -361,7 +347,7 @@
 }
 
 void TestRenderFrameHost::PrepareForCommit() {
-  PrepareForCommitInternal(GURL(), net::IPEndPoint(),
+  PrepareForCommitInternal(net::IPEndPoint(),
                            /* was_fetched_via_cache=*/false,
                            /* is_signed_exchange_inner_response=*/false,
                            net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN,
@@ -374,22 +360,12 @@
     bool is_signed_exchange_inner_response,
     net::HttpResponseInfo::ConnectionInfo connection_info,
     base::Optional<net::SSLInfo> ssl_info) {
-  PrepareForCommitInternal(GURL(), remote_endpoint, was_fetched_via_cache,
+  PrepareForCommitInternal(remote_endpoint, was_fetched_via_cache,
                            is_signed_exchange_inner_response, connection_info,
                            ssl_info);
 }
 
-void TestRenderFrameHost::PrepareForCommitWithServerRedirect(
-    const GURL& redirect_url) {
-  PrepareForCommitInternal(redirect_url, net::IPEndPoint(),
-                           /* was_fetched_via_cache=*/false,
-                           /* is_signed_exchange_inner_response=*/false,
-                           net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN,
-                           base::nullopt);
-}
-
 void TestRenderFrameHost::PrepareForCommitInternal(
-    const GURL& redirect_url,
     const net::IPEndPoint& remote_endpoint,
     bool was_fetched_via_cache,
     bool is_signed_exchange_inner_response,
@@ -425,10 +401,6 @@
       static_cast<TestNavigationURLLoader*>(request->loader_for_testing());
   CHECK(url_loader);
 
-  // If a non-empty |redirect_url| was provided, simulate a server redirect.
-  if (!redirect_url.is_empty())
-    url_loader->SimulateServerRedirect(redirect_url);
-
   // Simulate the network stack commit.
   scoped_refptr<network::ResourceResponse> response(
       new network::ResourceResponse);
@@ -443,11 +415,6 @@
   url_loader->CallOnResponseStarted(response, nullptr);
 }
 
-void TestRenderFrameHost::PrepareForCommitIfNecessary() {
-  if (frame_tree_node()->navigation_request())
-    PrepareForCommit();
-}
-
 void TestRenderFrameHost::SimulateCommitProcessed(
     NavigationRequest* navigation_request,
     std::unique_ptr<FrameHostMsg_DidCommitProvisionalLoad_Params> params,
diff --git a/content/test/test_render_frame_host.h b/content/test/test_render_frame_host.h
index c5dfa40..ec074d6 100644
--- a/content/test/test_render_frame_host.h
+++ b/content/test/test_render_frame_host.h
@@ -74,7 +74,7 @@
   void SendNavigateWithTransition(int nav_entry_id,
                                   bool did_create_new_entry,
                                   const GURL& url,
-                                  ui::PageTransition transition) override;
+                                  ui::PageTransition transition);
   void SendBeforeUnloadACK(bool proceed) override;
   void SimulateSwapOutACK() override;
   void SimulateFeaturePolicyHeader(
@@ -82,17 +82,9 @@
       const std::vector<url::Origin>& whitelist) override;
   const std::vector<std::string>& GetConsoleMessages() override;
 
-  using ModificationCallback =
-      base::Callback<void(FrameHostMsg_DidCommitProvisionalLoad_Params*)>;
-
   void SendNavigate(int nav_entry_id,
                     bool did_create_new_entry,
                     const GURL& url);
-  void SendNavigateWithModificationCallback(
-      int nav_entry_id,
-      bool did_create_new_entry,
-      const GURL& url,
-      const ModificationCallback& callback);
   void SendNavigateWithParams(
       FrameHostMsg_DidCommitProvisionalLoad_Params* params,
       bool was_within_same_document);
@@ -149,19 +141,6 @@
       net::HttpResponseInfo::ConnectionInfo connection_info,
       base::Optional<net::SSLInfo> ssl_info);
 
-  // This method does the same as PrepareForCommit.
-  // PlzNavigate: Beyond doing the same as PrepareForCommit, this method will
-  // also simulate a server redirect to |redirect_url|. If the URL is empty the
-  // redirect step is ignored.
-  void PrepareForCommitWithServerRedirect(const GURL& redirect_url);
-
-  // If we are doing a cross-site navigation, this simulates the current
-  // RenderFrameHost notifying that BeforeUnload has executed so the pending
-  // RenderFrameHost is resumed and can navigate.
-  // PlzNavigate: This simulates a BeforeUnload ACK from the renderer, and the
-  // interaction with the IO thread up until the response is ready to commit.
-  void PrepareForCommitIfNecessary();
-
   // Used to simulate the commit of a navigation having been processed in the
   // renderer. If parameters required to commit are not provided, they will be
   // set to default null values.
@@ -243,11 +222,9 @@
                                   bool did_create_new_entry,
                                   const GURL& url,
                                   ui::PageTransition transition,
-                                  int response_code,
-                                  const ModificationCallback& callback);
+                                  int response_code);
 
   void PrepareForCommitInternal(
-      const GURL& redirect_url,
       const net::IPEndPoint& remote_endpoint,
       bool was_fetched_via_cache,
       bool is_signed_exchange_inner_response,