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

Unified Diff: content/public/test/test_renderer_host.h

Issue 2296483002: Fix some unit_tests under PlzNavigate (Closed)
Patch Set: . Created 4 years, 4 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/public/test/test_renderer_host.h
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h
index 3a645cf51c92f2da3aae875fd2ba889c050eb873..74bcb5769268d57f1ddfeebed91c2448a945ab3c 100644
--- a/content/public/test/test_renderer_host.h
+++ b/content/public/test/test_renderer_host.h
@@ -96,6 +96,23 @@ class RenderFrameHostTester {
// Simulates a navigation stopping in the RenderFrameHost.
virtual void SimulateNavigationStop() = 0;
+ // If we are doing a cross-site navigation, this simulates the current RFH
clamy 2016/08/30 23:08:38 nit: s/RFH/RenderFrameHost here and below.
scottmg 2016/08/30 23:55:30 Done.
+ // notifying that it has unloaded so the pending RFH is resumed and can
+ // navigate.
+ // PlzNavigate: the pending RFH is not created before the navigation commit,
clamy 2016/08/30 23:08:38 This comment from "the pending RFH" to "deleted in
scottmg 2016/08/30 23:55:30 Done.
+ // so it is necessary to simulate the IO thread response here to commit in the
+ // proper renderer. It is necessary to call PrepareForCommit before getting
+ // the main and the pending frame because when we are trying to navigate to a
+ // webui from a new tab, a RenderFrameHost is created to display it that is
+ // committed immediately (since it is a new tab). Therefore the main frame is
+ // replaced without a pending frame being created, and we don't get the right
+ // values for the RFH to navigate: we try to use the old one that has been
+ // deleted in the meantime.
+ // Note that for some synchronous navigations (about:blank, javascript
+ // urls, etc.) there will be no NavigationRequest, and no simulation of the
clamy 2016/08/30 23:08:38 Please remove the mention of NavigationRequest, si
scottmg 2016/08/30 23:55:30 Done.
+ // network stack is required.
+ virtual void SimulateUnloading() = 0;
+
// Calls OnDidCommitProvisionalLoad on the RenderFrameHost with the given
// information with various sets of parameters. These are helper functions for
// simulating the most common types of loads.

Powered by Google App Engine
This is Rietveld 408576698