diff options
| author | clamy <clamy@chromium.org> | 2016-03-25 11:18:42 -0700 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-03-25 18:19:38 +0000 |
| commit | 8fadc69163a7b48cd24ed22ddfceb30e2348c966 (patch) | |
| tree | 223eb687b73ab65aa01e1aa0732b36017996121e /content | |
| parent | cac8709a0d06fee9d9f048b9e779ce59902673a5 (diff) | |
| download | chromium_src-8fadc69163a7b48cd24ed22ddfceb30e2348c966.zip chromium_src-8fadc69163a7b48cd24ed22ddfceb30e2348c966.tar.gz chromium_src-8fadc69163a7b48cd24ed22ddfceb30e2348c966.tar.bz2 | |
PlzNavigate: fix several WebContentsImpl tests
This CL fixes several WebContentsImplTests when run with PlzNavigate by making
sure they call the appropriate helper functions and having a definition of
CrossSiteNavigationPending that matches the one in the current navigation
codepath.
BUG=439423
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation
Review URL: https://codereview.chromium.org/1832443002
Cr-Commit-Position: refs/heads/master@{#383313}
Diffstat (limited to 'content')
| -rw-r--r-- | content/browser/frame_host/navigator_impl_unittest.cc | 2 | ||||
| -rw-r--r-- | content/browser/web_contents/web_contents_impl_unittest.cc | 4 | ||||
| -rw-r--r-- | content/test/test_web_contents.cc | 5 |
3 files changed, 2 insertions, 9 deletions
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc index fbe1106..6c93e1f 100644 --- a/content/browser/frame_host/navigator_impl_unittest.cc +++ b/content/browser/frame_host/navigator_impl_unittest.cc @@ -456,7 +456,6 @@ TEST_F(NavigatorTestWithBrowserSideNavigation, CrossSiteNavigation) { // Receive the beforeUnload ACK. main_test_rfh()->SendBeforeUnloadACK(true); EXPECT_EQ(speculative_rfh, GetSpeculativeRenderFrameHost(node)); - EXPECT_FALSE(contents()->CrossProcessNavigationPending()); scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(main_request)->CallOnResponseStarted( @@ -464,7 +463,6 @@ TEST_F(NavigatorTestWithBrowserSideNavigation, CrossSiteNavigation) { EXPECT_EQ(speculative_rfh, GetSpeculativeRenderFrameHost(node)); EXPECT_TRUE(DidRenderFrameHostRequestCommit(speculative_rfh)); EXPECT_FALSE(DidRenderFrameHostRequestCommit(main_test_rfh())); - EXPECT_TRUE(contents()->CrossProcessNavigationPending()); speculative_rfh->SendNavigate(0, entry_id, true, kUrl2); diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index 780f7f3..49c8c65 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc @@ -361,7 +361,6 @@ TEST_F(WebContentsImplTest, UpdateTitle) { InitNavigateParams(¶ms, 0, 0, true, GURL(url::kAboutBlankURL), ui::PAGE_TRANSITION_TYPED); - contents()->GetMainFrame()->PrepareForCommit(); contents()->GetMainFrame()->SendNavigateWithParams(¶ms); contents()->UpdateTitle(contents()->GetMainFrame(), 0, @@ -1395,6 +1394,7 @@ TEST_F(WebContentsImplTest, CrossSiteNotPreemptedDuringBeforeUnload) { url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); int entry1_id = controller().GetPendingEntry()->GetUniqueID(); TestRenderFrameHost* orig_rfh = contents()->GetMainFrame(); + orig_rfh->PrepareForCommit(); EXPECT_FALSE(contents()->CrossProcessNavigationPending()); // Navigate to new site, with the beforeunload request in flight. @@ -3040,7 +3040,6 @@ TEST_F(WebContentsImplTestWithSiteIsolation, StartStopEventsBalance) { controller().LoadURL( main_url, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); int entry_id = controller().GetPendingEntry()->GetUniqueID(); - orig_rfh->PrepareForCommit(); orig_rfh->OnMessageReceived( FrameHostMsg_DidStartLoading(orig_rfh->GetRoutingID(), false)); contents()->TestDidNavigate(orig_rfh, 1, entry_id, true, main_url, @@ -3056,7 +3055,6 @@ TEST_F(WebContentsImplTestWithSiteIsolation, StartStopEventsBalance) { // Navigate the child frame to about:blank, which will send both // DidStartLoading and DidStopLoading messages. { - subframe->SendRendererInitiatedNavigationRequest(initial_url, false); subframe->OnMessageReceived( FrameHostMsg_DidStartLoading(subframe->GetRoutingID(), true)); subframe->SendNavigateWithTransition(1, 0, false, initial_url, diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index c424f93..9dd81f6 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc @@ -148,10 +148,7 @@ const std::string& TestWebContents::GetSaveFrameHeaders() { bool TestWebContents::CrossProcessNavigationPending() { if (IsBrowserSideNavigationEnabled()) { - return GetRenderManager()->speculative_render_frame_host_ && - static_cast<TestRenderFrameHost*>( - GetRenderManager()->speculative_render_frame_host_.get()) - ->pending_commit(); + return GetRenderManager()->speculative_render_frame_host_ != nullptr; } return GetRenderManager()->pending_frame_host() != nullptr; } |
