OLD | NEW |
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/test/histogram_tester.h" | 8 #include "base/test/histogram_tester.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/browser/frame_host/cross_site_transferring_request.h" | 10 #include "content/browser/frame_host/cross_site_transferring_request.h" |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 | 1398 |
1399 // Use a cross-process navigation in the opener to swap out the old RVH. | 1399 // Use a cross-process navigation in the opener to swap out the old RVH. |
1400 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( | 1400 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( |
1401 rvh1->GetSiteInstance())); | 1401 rvh1->GetSiteInstance())); |
1402 opener1->NavigateAndCommit(kUrl2); | 1402 opener1->NavigateAndCommit(kUrl2); |
1403 EXPECT_TRUE(opener1_manager->GetSwappedOutRenderViewHost( | 1403 EXPECT_TRUE(opener1_manager->GetSwappedOutRenderViewHost( |
1404 rvh1->GetSiteInstance())); | 1404 rvh1->GetSiteInstance())); |
1405 | 1405 |
1406 // Fake a process crash. | 1406 // Fake a process crash. |
1407 RenderProcessHost::RendererClosedDetails details( | 1407 RenderProcessHost::RendererClosedDetails details( |
1408 rvh1->GetProcess()->GetHandle(), | |
1409 base::TERMINATION_STATUS_PROCESS_CRASHED, | 1408 base::TERMINATION_STATUS_PROCESS_CRASHED, |
1410 0); | 1409 0); |
1411 NotificationService::current()->Notify( | 1410 NotificationService::current()->Notify( |
1412 NOTIFICATION_RENDERER_PROCESS_CLOSED, | 1411 NOTIFICATION_RENDERER_PROCESS_CLOSED, |
1413 Source<RenderProcessHost>(rvh1->GetProcess()), | 1412 Source<RenderProcessHost>(rvh1->GetProcess()), |
1414 Details<RenderProcessHost::RendererClosedDetails>(&details)); | 1413 Details<RenderProcessHost::RendererClosedDetails>(&details)); |
1415 rvh1->set_render_view_created(false); | 1414 rvh1->set_render_view_created(false); |
1416 | 1415 |
1417 // Ensure that the swapped out RenderViewHost has been deleted. | 1416 // Ensure that the swapped out RenderViewHost has been deleted. |
1418 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( | 1417 EXPECT_FALSE(opener1_manager->GetSwappedOutRenderViewHost( |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 pending_rfh->GetSiteInstance()->increment_active_frame_count(); | 1797 pending_rfh->GetSiteInstance()->increment_active_frame_count(); |
1799 | 1798 |
1800 contents()->GetMainFrame()->OnMessageReceived( | 1799 contents()->GetMainFrame()->OnMessageReceived( |
1801 FrameHostMsg_BeforeUnload_ACK(0, false, now, now)); | 1800 FrameHostMsg_BeforeUnload_ACK(0, false, now, now)); |
1802 EXPECT_FALSE(contents()->cross_navigation_pending()); | 1801 EXPECT_FALSE(contents()->cross_navigation_pending()); |
1803 EXPECT_FALSE(rfh_deleted_observer.deleted()); | 1802 EXPECT_FALSE(rfh_deleted_observer.deleted()); |
1804 } | 1803 } |
1805 } | 1804 } |
1806 | 1805 |
1807 } // namespace content | 1806 } // namespace content |
OLD | NEW |