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

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: 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"
13 #include "content/browser/frame_host/navigator_impl.h"
12 #include "content/browser/frame_host/render_frame_host_manager.h" 14 #include "content/browser/frame_host/render_frame_host_manager.h"
13 #include "content/browser/site_instance_impl.h" 15 #include "content/browser/site_instance_impl.h"
14 #include "content/browser/webui/web_ui_controller_factory_registry.h" 16 #include "content/browser/webui/web_ui_controller_factory_registry.h"
15 #include "content/common/view_messages.h" 17 #include "content/common/view_messages.h"
16 #include "content/public/browser/notification_details.h" 18 #include "content/public/browser/notification_details.h"
17 #include "content/public/browser/notification_service.h" 19 #include "content/public/browser/notification_service.h"
18 #include "content/public/browser/notification_source.h" 20 #include "content/public/browser/notification_source.h"
19 #include "content/public/browser/notification_types.h" 21 #include "content/public/browser/notification_types.h"
20 #include "content/public/browser/render_process_host.h" 22 #include "content/public/browser/render_process_host.h"
21 #include "content/public/browser/render_widget_host_iterator.h" 23 #include "content/public/browser/render_widget_host_iterator.h"
(...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 NavigationRequest* main_request = 1886 NavigationRequest* main_request =
1885 NavigationRequestForRenderFrameManager( 1887 NavigationRequestForRenderFrameManager(
1886 main_test_rfh()->frame_tree_node()->render_manager()); 1888 main_test_rfh()->frame_tree_node()->render_manager());
1887 ASSERT_TRUE(main_request); 1889 ASSERT_TRUE(main_request);
1888 EXPECT_EQ(kUrl3, main_request->info_for_testing().navigation_params.url); 1890 EXPECT_EQ(kUrl3, main_request->info_for_testing().navigation_params.url);
1889 EXPECT_EQ(kUrl3, main_request->info_for_testing().first_party_for_cookies); 1891 EXPECT_EQ(kUrl3, main_request->info_for_testing().first_party_for_cookies);
1890 EXPECT_TRUE(main_request->info_for_testing().is_main_frame); 1892 EXPECT_TRUE(main_request->info_for_testing().is_main_frame);
1891 EXPECT_FALSE(main_request->info_for_testing().parent_is_main_frame); 1893 EXPECT_FALSE(main_request->info_for_testing().parent_is_main_frame);
1892 } 1894 }
1893 1895
1896 // Browser side navigation: Test that RequestNavigation creates a
1897 // NavigationRequest and that a RenderFrameHost is initialized to handle the
1898 // request when it commits.
1899 TEST_F(RenderFrameHostManagerTest,
1900 BrowserSideNavigationRequestNavigationNoLiveRenderer) {
1901 const GURL kUrl("http://www.google.com/");
1902
1903 EXPECT_FALSE(main_test_rfh()->render_view_host()->IsRenderViewLive());
1904 NavigationEntryImpl entry = NavigationEntryImpl(
1905 NULL, 0, kUrl, Referrer(), base::string16(), PAGE_TRANSITION_LINK, false);
1906 FrameMsg_Navigate_Params navigate_params;
1907 NavigatorImpl::MakeNavigateParams(
1908 entry,
1909 contents()->GetController(),
1910 NavigationController::NO_RELOAD,
1911 base::TimeTicks::Now(),
1912 &navigate_params);
1913 main_test_rfh()->frame_tree_node()->render_manager()->RequestNavigation(
1914 entry, navigate_params);
1915 NavigationRequest* main_request =
1916 NavigationRequestForRenderFrameManager(
1917 main_test_rfh()->frame_tree_node()->render_manager());
1918 // A NavigationRequest should have been generated.
1919 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.
1920 // The RFH should have been initialized to handle the navigation when it
1921 // commits.
1922 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
1923 }
1924
1894 } // namespace content 1925 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698