Index: content/test/test_web_contents.h |
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h |
index 83ce185657f4398127f55c039ce486e1d341a9d3..074fbfe424ea19a7e249a4f2c41137bae023cc28 100644 |
--- a/content/test/test_web_contents.h |
+++ b/content/test/test_web_contents.h |
@@ -96,6 +96,43 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { |
int error_code, |
const base::string16& error_description); |
+ // Simulates the renderer reponse for a navigation. Currently, this is |
+ // receiving the BeforeUnload ack for a cross-site navigation. |
+ // PlzNavigate: this simulates receiving a BeginNavigation IPC in response to |
+ // a RequestNavigation IPC. |
+ void ProceedNavigationWithRendererResponse(const GURL& url); |
+ |
+ // Commits the pending navigation and simulates clearing the history. |
+ // Note: this function does not simulate receiving the SwapOut ACK from the |
+ // old renderer during cross-site navigations. |
+ void CommitPendingNavigationWithHistoryCleared( |
+ bool had_live_renderer, |
+ bool simulate_history_list_was_cleared); |
+ |
+ // Commits a navigation with the particular url |url| and the page ID |
+ // |page_id|. |
+ // Note: this function does not simulate receiving the SwapOut ACK from the |
+ // old renderer during cross-site navigations. |
+ void CommitNavigationWithPageID(int page_id, |
+ const GURL& url, |
+ bool had_live_renderer); |
+ |
+ // Commits the pending navigation and simulates giving the bindings |
+ // |binding_flags| to the renderer that commits it. |
+ // Note: this function does not simulate receiving the SwapOut ACK from the |
+ // old renderer during cross-site navigations. |
+ void CommitPendingNavigationWithBindings(int binding_flags, |
+ bool had_live_renderer); |
+ |
+ // Commits the pending navigation when no live renderer was present when the |
+ // navigation started. |
+ void CommitPendingNavigationNoLiveRenderer(); |
+ |
+ // Simulates the commit of a renderer initiated navigation. |
+ // PlzNavigate: also simulates receiving a BeginNavigation IPC from the |
+ // renderer before the DidCommitProvisionalLoad IPC. |
+ void SimulateRendererInitiatedNavigation(int page_id, const GURL& url); |
+ |
protected: |
// The deprecated WebContentsTester still needs to subclass this. |
explicit TestWebContents(BrowserContext* browser_context); |
@@ -119,6 +156,22 @@ class TestWebContents : public WebContentsImpl, public WebContentsTester { |
void ShowCreatedWidget(int route_id, const gfx::Rect& initial_pos) override; |
void ShowCreatedFullscreenWidget(int route_id) override; |
+ // Commits a navigation with the specified params. If |page_id| is -1, then an |
+ // appropriate page id is computed based on the pending navigation entry. |
+ // Otherwise the navigation will be committed with the specified |page_id|. |
+ // Note: this function does not simulate receiving the SwapOut ACK from the |
+ // old renderer during cross-site navigations. |
+ void CommitNavigationWithParams(int32 page_id, |
+ const GURL& url, |
+ bool had_live_renderer, |
+ bool simulate_history_list_was_cleared, |
+ int binding_flags); |
+ |
+ // PlzNavigate |
+ // Simulates receiving a BeginNavigation IPC in response to a |
+ // RequestNavigation IPC. |
+ void SimulateIOThreadResponse(); |
+ |
RenderViewHostDelegateView* delegate_view_override_; |
// Expectations for arguments of |SetHistoryLengthAndPrune()|. |