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

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: 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..5bd9c3318ec9a0100f296629d95bd9150df3d0a6 100644
--- a/content/browser/frame_host/render_frame_host_manager_unittest.cc
+++ b/content/browser/frame_host/render_frame_host_manager_unittest.cc
@@ -4,11 +4,13 @@
#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"
#include "content/browser/frame_host/navigation_request.h"
#include "content/browser/frame_host/navigator.h"
+#include "content/browser/frame_host/navigator_impl.h"
#include "content/browser/frame_host/render_frame_host_manager.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/webui/web_ui_controller_factory_registry.h"
@@ -1891,4 +1893,33 @@ 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;
+ NavigatorImpl::MakeNavigateParams(
+ entry,
+ 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);
nasko 2014/07/17 12:05:08 main_request is a pointer, not boolean. Use EXPECT
clamy 2014/07/17 13:07:53 Done.
+ // The RFH should have been initialized to handle the navigation when it
+ // commits.
+ EXPECT_TRUE(main_test_rfh()->render_view_host()->IsRenderViewLive());
nasko 2014/07/17 12:05:08 Shouldn't the main RFH also be the speculative RFH
clamy 2014/07/17 13:07:53 The speculative RFH cannot be the main RFH. The sp
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698