diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-06-27 11:18:24 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-07-03 09:38:30 +0000 |
commit | d94af01c90575348c4e81a418257f254b6f8d225 (patch) | |
tree | 77a26669b33eaa4d46b88b07e17dacc61eba6001 /chromium/content/browser/site_per_process_browsertest.cc | |
parent | 5d87695f37678f96492b258bbab36486c59866b4 (diff) | |
download | qtwebengine-chromium-d94af01c90575348c4e81a418257f254b6f8d225.tar.gz |
BASELINE: Update Chromium to 75.0.3770.116
Change-Id: Ifcd5227841577e8ce81a1b7a54c56caba4d85e02
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/content/browser/site_per_process_browsertest.cc')
-rw-r--r-- | chromium/content/browser/site_per_process_browsertest.cc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/chromium/content/browser/site_per_process_browsertest.cc b/chromium/content/browser/site_per_process_browsertest.cc index 4b1e01a419f..eec2a9b2482 100644 --- a/chromium/content/browser/site_per_process_browsertest.cc +++ b/chromium/content/browser/site_per_process_browsertest.cc @@ -14467,6 +14467,42 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, actual_scroll_delta); } +// Check that if a frame starts a navigation, and the frame's current process +// dies before the response for the navigation comes back, the response will +// not trigger a process kill and will be allowed to commit in a new process. +// See https://crbug.com/968259. +IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, + ProcessDiesBeforeCrossSiteNavigationCompletes) { + GURL first_url(embedded_test_server()->GetURL("a.com", "/title1.html")); + EXPECT_TRUE(NavigateToURL(shell(), first_url)); + scoped_refptr<SiteInstanceImpl> first_site_instance( + web_contents()->GetMainFrame()->GetSiteInstance()); + + // Start a cross-site navigation and proceed only up to the request start. + GURL second_url(embedded_test_server()->GetURL("b.com", "/title1.html")); + TestNavigationManager delayer(web_contents(), second_url); + EXPECT_TRUE(ExecuteScript(shell(), JsReplace("location = $1", second_url))); + EXPECT_TRUE(delayer.WaitForRequestStart()); + + // Terminate the current a.com process. + RenderProcessHost* first_process = + web_contents()->GetMainFrame()->GetProcess(); + RenderProcessHostWatcher crash_observer( + first_process, RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + EXPECT_TRUE(first_process->Shutdown(0)); + crash_observer.Wait(); + EXPECT_FALSE(web_contents()->GetMainFrame()->IsRenderFrameLive()); + + // Resume the cross-site navigation and ensure it commits in a new + // SiteInstance and process. + delayer.WaitForNavigationFinished(); + EXPECT_TRUE(web_contents()->GetMainFrame()->IsRenderFrameLive()); + EXPECT_NE(web_contents()->GetMainFrame()->GetProcess(), first_process); + EXPECT_NE(web_contents()->GetMainFrame()->GetSiteInstance(), + first_site_instance); + EXPECT_EQ(second_url, web_contents()->GetMainFrame()->GetLastCommittedURL()); +} + class FeaturePolicyPropagationToAuxiliaryBrowsingContextTest : public SitePerProcessFeaturePolicyJavaScriptBrowserTest, public testing::WithParamInterface<std::tuple< |