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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "base/time/time.h"
7 #include "content/browser/frame_host/cross_site_transferring_request.h" 8 #include "content/browser/frame_host/cross_site_transferring_request.h"
8 #include "content/browser/frame_host/navigation_controller_impl.h" 9 #include "content/browser/frame_host/navigation_controller_impl.h"
9 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
10 #include "content/browser/frame_host/navigation_request.h" 11 #include "content/browser/frame_host/navigation_request.h"
11 #include "content/browser/frame_host/navigator.h" 12 #include "content/browser/frame_host/navigator.h"
12 #include "content/browser/frame_host/render_frame_host_manager.h" 13 #include "content/browser/frame_host/render_frame_host_manager.h"
13 #include "content/browser/site_instance_impl.h" 14 #include "content/browser/site_instance_impl.h"
14 #include "content/browser/webui/web_ui_controller_factory_registry.h" 15 #include "content/browser/webui/web_ui_controller_factory_registry.h"
15 #include "content/common/view_messages.h" 16 #include "content/common/view_messages.h"
16 #include "content/public/browser/notification_details.h" 17 #include "content/public/browser/notification_details.h"
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 NavigationRequest* main_request = 1885 NavigationRequest* main_request =
1885 NavigationRequestForRenderFrameManager( 1886 NavigationRequestForRenderFrameManager(
1886 main_test_rfh()->frame_tree_node()->render_manager()); 1887 main_test_rfh()->frame_tree_node()->render_manager());
1887 ASSERT_TRUE(main_request); 1888 ASSERT_TRUE(main_request);
1888 EXPECT_EQ(kUrl3, main_request->info_for_testing().navigation_params.url); 1889 EXPECT_EQ(kUrl3, main_request->info_for_testing().navigation_params.url);
1889 EXPECT_EQ(kUrl3, main_request->info_for_testing().first_party_for_cookies); 1890 EXPECT_EQ(kUrl3, main_request->info_for_testing().first_party_for_cookies);
1890 EXPECT_TRUE(main_request->info_for_testing().is_main_frame); 1891 EXPECT_TRUE(main_request->info_for_testing().is_main_frame);
1891 EXPECT_FALSE(main_request->info_for_testing().parent_is_main_frame); 1892 EXPECT_FALSE(main_request->info_for_testing().parent_is_main_frame);
1892 } 1893 }
1893 1894
1895 // Browser side navigation: Test that RequestNavigation creates a
1896 // NavigationRequest and that a RenderFrameHost is initialized to handle the
1897 // request when it commits.
1898 TEST_F(RenderFrameHostManagerTest,
1899 BrowserSideNavigationRequestNavigationNoLiveRenderer) {
1900 const GURL kUrl("http://www.google.com/");
1901
1902 EXPECT_FALSE(main_test_rfh()->render_view_host()->IsRenderViewLive());
1903 NavigationEntryImpl entry = NavigationEntryImpl(
1904 NULL, 0, kUrl, Referrer(), base::string16(), PAGE_TRANSITION_LINK, false);
1905 FrameMsg_Navigate_Params navigate_params;
1906 entry.MakeNavigateParams(contents()->GetController(),
1907 NavigationController::NO_RELOAD,
1908 base::TimeTicks::Now(),
1909 &navigate_params);
1910 main_test_rfh()->frame_tree_node()->render_manager()->RequestNavigation(
1911 entry, navigate_params);
1912 NavigationRequest* main_request =
1913 NavigationRequestForRenderFrameManager(
1914 main_test_rfh()->frame_tree_node()->render_manager());
1915 // A NavigationRequest should have been generated.
1916 EXPECT_TRUE(main_request);
1917 // The RFH should have been initialized to handle the navigation when it
1918 // commits.
1919 EXPECT_TRUE(main_test_rfh()->render_view_host()->IsRenderViewLive());
1920 }
1921
1894 } // namespace content 1922 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698