diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-05 14:08:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-11 07:46:53 +0000 |
commit | 6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (patch) | |
tree | ab00f70a5e89278d6a0d16ff0c42578dc4d84a2d /chromium/content/browser/security_exploit_browsertest.cc | |
parent | e733310db58160074f574c429d48f8308c0afe17 (diff) | |
download | qtwebengine-chromium-6a4cabb866f66d4128a97cdc6d9d08ce074f1247.tar.gz |
BASELINE: Update Chromium to 57.0.2987.144
Change-Id: I29db402ff696c71a04c4dbaec822c2e53efe0267
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/content/browser/security_exploit_browsertest.cc')
-rw-r--r-- | chromium/content/browser/security_exploit_browsertest.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/chromium/content/browser/security_exploit_browsertest.cc b/chromium/content/browser/security_exploit_browsertest.cc index 53622ac0df4..b1da4020682 100644 --- a/chromium/content/browser/security_exploit_browsertest.cc +++ b/chromium/content/browser/security_exploit_browsertest.cc @@ -79,8 +79,8 @@ RenderViewHostImpl* PrepareToDuplicateHosts(Shell* shell, Shell* shell2 = shell2_observer.GetShell(); // The new window must be in the same process, but have a new routing id. - EXPECT_EQ(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(), - shell2->web_contents()->GetRenderViewHost()->GetProcess()->GetID()); + EXPECT_EQ(shell->web_contents()->GetMainFrame()->GetProcess()->GetID(), + shell2->web_contents()->GetMainFrame()->GetProcess()->GetID()); *target_routing_id = shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); EXPECT_NE(*target_routing_id, @@ -180,7 +180,11 @@ class SecurityExploitBrowserTest : public ContentBrowserTest { SecurityExploitBrowserTest() {} void SetUpCommandLine(base::CommandLine* command_line) override { - ASSERT_TRUE(embedded_test_server()->Start()); + // EmbeddedTestServer::InitializeAndListen() initializes its |base_url_| + // which is required below. This cannot invoke Start() however as that kicks + // off the "EmbeddedTestServer IO Thread" which then races with + // initialization in ContentBrowserTest::SetUp(), http://crbug.com/674545. + ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); // Add a host resolver rule to map all outgoing requests to the test server. // This allows us to use "real" hostnames in URLs, which we can use to @@ -194,6 +198,10 @@ class SecurityExploitBrowserTest : public ContentBrowserTest { } void SetUpOnMainThread() override { + // Complete the manual Start() after ContentBrowserTest's own + // initialization, ref. comment on InitializeAndListen() above. + embedded_test_server()->StartAcceptingConnections(); + BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&net::URLRequestSlowDownloadJob::AddUrlHandler)); @@ -273,10 +281,11 @@ IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, // TODO(avi): This should be made unique from the view routing ID once // RenderViewHostImpl has-a RenderWidgetHostImpl. https://crbug.com/545684 int32_t main_frame_widget_routing_id = duplicate_routing_id; - pending_rvh->CreateNewWindow(duplicate_routing_id, main_frame_routing_id, - main_frame_widget_routing_id, - mojom::CreateNewWindowParams(), - session_storage.get()); + static_cast<RenderFrameHostImpl*>(pending_rvh->GetMainFrame()) + ->OnCreateNewWindow(duplicate_routing_id, main_frame_routing_id, + main_frame_widget_routing_id, + mojom::CreateNewWindowParams(), + session_storage.get()); // If the above operation doesn't cause a crash, the test has succeeded! } |