OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // process. | 261 // process. |
262 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, | 262 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, |
263 AttemptDuplicateRenderViewHost) { | 263 AttemptDuplicateRenderViewHost) { |
264 int32_t duplicate_routing_id = MSG_ROUTING_NONE; | 264 int32_t duplicate_routing_id = MSG_ROUTING_NONE; |
265 RenderViewHostImpl* pending_rvh = | 265 RenderViewHostImpl* pending_rvh = |
266 PrepareToDuplicateHosts(shell(), &duplicate_routing_id); | 266 PrepareToDuplicateHosts(shell(), &duplicate_routing_id); |
267 EXPECT_NE(MSG_ROUTING_NONE, duplicate_routing_id); | 267 EXPECT_NE(MSG_ROUTING_NONE, duplicate_routing_id); |
268 | 268 |
269 RenderFrameHostImpl* opener = | 269 RenderFrameHostImpl* opener = |
270 static_cast<RenderFrameHostImpl*>(pending_rvh->GetMainFrame()); | 270 static_cast<RenderFrameHostImpl*>(pending_rvh->GetMainFrame()); |
271 mojom::CreateNewWindowParamsPtr params; | 271 mojom::CreateNewWindowParamsPtr params = mojom::CreateNewWindowParams::New(); |
| 272 params->target_url = GURL("about:blank"); |
272 opener->CreateNewWindow(std::move(params), | 273 opener->CreateNewWindow(std::move(params), |
273 base::Bind([](mojom::CreateNewWindowReplyPtr) {})); | 274 base::Bind([](mojom::CreateNewWindowReplyPtr) {})); |
274 // If the above operation doesn't cause a crash, the test has succeeded! | 275 // If the above operation doesn't cause a crash, the test has succeeded! |
275 } | 276 } |
276 | 277 |
277 // This is a test for crbug.com/312016. It tries to create two RenderWidgetHosts | 278 // This is a test for crbug.com/312016. It tries to create two RenderWidgetHosts |
278 // with the same process and routing ids, which causes a collision. It is almost | 279 // with the same process and routing ids, which causes a collision. It is almost |
279 // identical to the AttemptDuplicateRenderViewHost test case. | 280 // identical to the AttemptDuplicateRenderViewHost test case. |
280 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, | 281 IN_PROC_BROWSER_TEST_F(SecurityExploitBrowserTest, |
281 AttemptDuplicateRenderWidgetHost) { | 282 AttemptDuplicateRenderWidgetHost) { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // separate task of the message loop, so ensure that the process is still | 553 // separate task of the message loop, so ensure that the process is still |
553 // considered alive. | 554 // considered alive. |
554 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); | 555 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); |
555 | 556 |
556 exit_observer.Wait(); | 557 exit_observer.Wait(); |
557 EXPECT_FALSE(exit_observer.did_exit_normally()); | 558 EXPECT_FALSE(exit_observer.did_exit_normally()); |
558 ResourceDispatcherHost::Get()->SetDelegate(nullptr); | 559 ResourceDispatcherHost::Get()->SetDelegate(nullptr); |
559 } | 560 } |
560 | 561 |
561 } // namespace content | 562 } // namespace content |
OLD | NEW |