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

Unified Diff: content/browser/frame_host/render_frame_host_manager_unittest.cc

Issue 379143002: PlzNavigate: implement RequestNavigation in the no live renderer case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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/browser/frame_host/render_frame_host_manager_unittest.cc
diff --git a/content/browser/frame_host/render_frame_host_manager_unittest.cc b/content/browser/frame_host/render_frame_host_manager_unittest.cc
index 7ac3f3727e65ee9b7c8b1bea9d9d35da835e5bd5..68b5ca329838fa11a3f3c2c79e02345d2534d626 100644
--- a/content/browser/frame_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc
@@ -4,6 +4,7 @@
#include "base/files/file_path.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time/time.h"
#include "content/browser/frame_host/cross_site_transferring_request.h"
#include "content/browser/frame_host/navigation_controller_impl.h"
#include "content/browser/frame_host/navigation_entry_impl.h"
@@ -1891,4 +1892,31 @@ TEST_F(RenderFrameHostManagerTest, BrowserSideNavigationBeginNavigation) {
EXPECT_FALSE(main_request->info_for_testing().parent_is_main_frame);
}
+// Browser side navigation: Test that RequestNavigation creates a
+// NavigationRequest and that a RenderFrameHost is initialized to handle the
+// request when it commits.
+TEST_F(RenderFrameHostManagerTest,
+ BrowserSideNavigationRequestNavigationNoLiveRenderer) {
+ const GURL kUrl("http://www.google.com/");
+
+ EXPECT_FALSE(main_test_rfh()->render_view_host()->IsRenderViewLive());
+ NavigationEntryImpl entry = NavigationEntryImpl(
+ NULL, 0, kUrl, Referrer(), base::string16(), PAGE_TRANSITION_LINK, false);
+ FrameMsg_Navigate_Params navigate_params;
+ entry.MakeNavigateParams(contents()->GetController(),
+ NavigationController::NO_RELOAD,
+ base::TimeTicks::Now(),
+ &navigate_params);
+ main_test_rfh()->frame_tree_node()->render_manager()->RequestNavigation(
+ entry, navigate_params);
+ NavigationRequest* main_request =
+ NavigationRequestForRenderFrameManager(
+ main_test_rfh()->frame_tree_node()->render_manager());
+ // A NavigationRequest should have been generated.
+ EXPECT_TRUE(main_request);
+ // The RFH should have been initialized to handle the navigation when it
+ // commits.
+ EXPECT_TRUE(main_test_rfh()->render_view_host()->IsRenderViewLive());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698