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

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_unittest.cc

Issue 536473002: PlzNavigate: Initialize the renderer on commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "content/browser/frame_host/cross_site_transferring_request.h" 9 #include "content/browser/frame_host/cross_site_transferring_request.h"
10 #include "content/browser/frame_host/navigation_before_commit_info.h" 10 #include "content/browser/frame_host/navigation_before_commit_info.h"
(...skipping 1740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 // A NavigationRequest should have been generated. 1751 // A NavigationRequest should have been generated.
1752 EXPECT_TRUE(main_request != NULL); 1752 EXPECT_TRUE(main_request != NULL);
1753 RenderFrameHostImpl* rfh = main_test_rfh(); 1753 RenderFrameHostImpl* rfh = main_test_rfh();
1754 1754
1755 // Now commit the same url. 1755 // Now commit the same url.
1756 NavigationBeforeCommitInfo commit_info; 1756 NavigationBeforeCommitInfo commit_info;
1757 commit_info.navigation_url = kUrl; 1757 commit_info.navigation_url = kUrl;
1758 render_manager->CommitNavigation(commit_info); 1758 render_manager->CommitNavigation(commit_info);
1759 main_request = GetNavigationRequestForRenderFrameManager(render_manager); 1759 main_request = GetNavigationRequestForRenderFrameManager(render_manager);
1760 1760
1761 // The main RFH should not have been changed. 1761 // The main RFH should not have been changed, and the renderer should have
1762 // been initialized.
1762 EXPECT_EQ(rfh, main_test_rfh()); 1763 EXPECT_EQ(rfh, main_test_rfh());
1764 EXPECT_TRUE(main_test_rfh()->render_view_host()->IsRenderViewLive());
1763 } 1765 }
1764 1766
1765 // PlzNavigate: Test that a new RenderFrameHost is created when doing a cross 1767 // PlzNavigate: Test that a new RenderFrameHost is created when doing a cross
1766 // site navigation. 1768 // site navigation.
1767 TEST_F(RenderFrameHostManagerTest, 1769 TEST_F(RenderFrameHostManagerTest,
1768 BrowserSideNavigationCrossSiteNavigation) { 1770 BrowserSideNavigationCrossSiteNavigation) {
1769 const GURL kUrl1("http://www.chromium.org/"); 1771 const GURL kUrl1("http://www.chromium.org/");
1770 const GURL kUrl2("http://www.google.com/"); 1772 const GURL kUrl2("http://www.google.com/");
1771 1773
1772 // TODO(clamy): we should be enabling browser side navigations here 1774 // TODO(clamy): we should be enabling browser side navigations here
(...skipping 11 matching lines...) Expand all
1784 main_test_rfh()->SendBeginNavigationWithURL(kUrl2); 1786 main_test_rfh()->SendBeginNavigationWithURL(kUrl2);
1785 NavigationRequest* main_request = 1787 NavigationRequest* main_request =
1786 GetNavigationRequestForRenderFrameManager(render_manager); 1788 GetNavigationRequestForRenderFrameManager(render_manager);
1787 ASSERT_TRUE(main_request); 1789 ASSERT_TRUE(main_request);
1788 1790
1789 NavigationBeforeCommitInfo commit_info; 1791 NavigationBeforeCommitInfo commit_info;
1790 commit_info.navigation_url = kUrl2; 1792 commit_info.navigation_url = kUrl2;
1791 render_manager->CommitNavigation(commit_info); 1793 render_manager->CommitNavigation(commit_info);
1792 main_request = GetNavigationRequestForRenderFrameManager(render_manager); 1794 main_request = GetNavigationRequestForRenderFrameManager(render_manager);
1793 EXPECT_NE(main_test_rfh(), rfh); 1795 EXPECT_NE(main_test_rfh(), rfh);
1796 EXPECT_TRUE(main_test_rfh()->render_view_host()->IsRenderViewLive());
1794 } 1797 }
1795 1798
1796 } // namespace content 1799 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698