Chromium Code Reviews| Index: content/test/test_render_frame_host.cc |
| diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc |
| index e6284f3fb6bfcea4cd15dba70c32256e5db34d62..26578a0f4cff1fe635f2339db1429f2d6a0ab3ed 100644 |
| --- a/content/test/test_render_frame_host.cc |
| +++ b/content/test/test_render_frame_host.cc |
| @@ -14,6 +14,7 @@ |
| #include "content/browser/web_contents/web_contents_impl.h" |
| #include "content/common/frame_messages.h" |
| #include "content/common/frame_owner_properties.h" |
| +#include "content/public/browser/navigation_throttle.h" |
| #include "content/public/browser/stream_handle.h" |
| #include "content/public/common/browser_side_navigation_policy.h" |
| #include "content/public/common/url_constants.h" |
| @@ -106,6 +107,7 @@ void TestRenderFrameHost::SimulateNavigationStart(const GURL& url) { |
| OnDidStartLoading(true); |
| OnDidStartProvisionalLoad(url, base::TimeTicks::Now()); |
| + SimulateWillStartRequest(ui::PAGE_TRANSITION_LINK); |
| } |
| void TestRenderFrameHost::SimulateRedirect(const GURL& new_url) { |
| @@ -290,6 +292,7 @@ void TestRenderFrameHost::SendNavigateWithParameters( |
| // so we keep a copy of it to use below. |
| GURL url_copy(url); |
| OnDidStartProvisionalLoad(url_copy, base::TimeTicks::Now()); |
| + SimulateWillStartRequest(transition); |
|
clamy
2016/07/21 16:17:29
It seems to me that we could potentially end up si
|
| FrameHostMsg_DidCommitProvisionalLoad_Params params; |
| params.page_id = page_id; |
| @@ -440,4 +443,12 @@ int32_t TestRenderFrameHost::ComputeNextPageID() { |
| return page_id; |
| } |
| +void TestRenderFrameHost::SimulateWillStartRequest( |
| + ui::PageTransition transition) { |
| + DCHECK(navigation_handle()); |
| + navigation_handle()->CallWillStartRequestForTesting( |
| + false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault), |
| + true /* user_gesture */, transition, false /* is_external_protocol */); |
| +} |
| + |
| } // namespace content |