Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2368)

Unified Diff: content/test/test_render_frame_host.cc

Issue 2157153003: Call WillStartRequestForTesting in TestRenderFrameHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge session / remove DCHECK Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 115d6069a172c12b9e581da70aacecb2d527281a..b8627a308f749d9047d2c0a56b2bdbd4e70f7eb9 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -13,6 +13,7 @@
#include "content/browser/frame_host/render_frame_host_delegate.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/frame_messages.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"
@@ -105,6 +106,7 @@ void TestRenderFrameHost::SimulateNavigationStart(const GURL& url) {
OnDidStartLoading(true);
OnDidStartProvisionalLoad(url, base::TimeTicks::Now());
+ SimulateWillStartRequest();
}
void TestRenderFrameHost::SimulateRedirect(const GURL& new_url) {
@@ -289,6 +291,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();
FrameHostMsg_DidCommitProvisionalLoad_Params params;
params.page_id = page_id;
@@ -439,4 +442,12 @@ int32_t TestRenderFrameHost::ComputeNextPageID() {
return page_id;
}
+void TestRenderFrameHost::SimulateWillStartRequest() {
+ DCHECK(navigation_handle());
+ navigation_handle()->CallWillStartRequestForTesting(
+ false /* is_post */, Referrer(GURL(), blink::WebReferrerPolicyDefault),
+ true /* user_gesture */, ui::PAGE_TRANSITION_LINK,
+ false /* is_external_protocol */);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698