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

Unified Diff: content/test/test_render_frame_host.h

Issue 953503002: PlzNavigate: test updates post beforeUnload IPC refactor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor changes from last round of comments. Created 5 years, 10 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.h
diff --git a/content/test/test_render_frame_host.h b/content/test/test_render_frame_host.h
index fcf4a743655636f287c6fdd66b1c4cc16bcedf84..2e125c9c25a3d41066ba556727c63411368622c6 100644
--- a/content/test/test_render_frame_host.h
+++ b/content/test/test_render_frame_host.h
@@ -85,7 +85,11 @@ class TestRenderFrameHost : public RenderFrameHostImpl,
int response_code,
const base::FilePath* file_path_for_history_item,
const std::vector<GURL>& redirects);
- void SendBeginNavigationWithURL(const GURL& url, bool has_user_gesture);
+
+ // With the current navigation logic this method is a no-op.
+ // PlzNavigate: this method simulates receiving a BeginNavigation IPC.
+ void SendRendererInitiatedNavigationRequest(const GURL& url,
+ bool has_user_gesture);
void DidDisownOpener();
@@ -102,7 +106,12 @@ class TestRenderFrameHost : public RenderFrameHostImpl,
// this simulates a BeforeUnload ACK from the renderer.
// 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 PrepareForCommit(const GURL& url);
+ void PrepareForCommit();
nasko 2015/02/26 01:27:42 Love that we no longer have the parameter!
+
+ // This method does the same as PrepareForCommit.
+ // PlzNavigate: Beyond doing the same as PrepareForCommit, this method will
+ // also simulate a server redirect IPC to |redirect_url|.
nasko 2015/02/26 01:27:42 nit: Server redirect is not an IPC.
carlosk 2015/02/26 11:03:45 Indeed. Updated the comment.
+ void PrepareForCommitWithServerRedirect(const GURL& redirect_url);
// Simulate receiving a FrameHostMsg_BeforeUnloadHandlersPresent.
void SendBeforeUnloadHandlersPresent(bool present);
@@ -111,6 +120,11 @@ class TestRenderFrameHost : public RenderFrameHostImpl,
void SendUnloadHandlersPresent(bool present);
private:
+ // Actual implementation of both PrepareForCommit* methods.
+ // PlzNavigate: If |redirect_url| is not nullptr, it will be used to simulate
nasko 2015/02/26 01:27:42 Why not use const GURL& as the parameter and empty
carlosk 2015/02/26 11:03:45 I am playing safe. I was afraid an empty GURL coul
+ // a PlzNavigate server redirect.
+ void PrepareForCommitInternal(const GURL* redirect_url);
+
TestRenderFrameHostCreationObserver child_creation_observer_;
std::string contents_mime_type_;

Powered by Google App Engine
This is Rietveld 408576698