| 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 "content/browser/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_host_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1720 EXPECT_TRUE(rfh1->render_view_host()->is_waiting_for_close_ack()); | 1720 EXPECT_TRUE(rfh1->render_view_host()->is_waiting_for_close_ack()); |
| 1721 | 1721 |
| 1722 // Start a navigation to a new site. | 1722 // Start a navigation to a new site. |
| 1723 controller().LoadURL( | 1723 controller().LoadURL( |
| 1724 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); | 1724 kUrl2, Referrer(), ui::PAGE_TRANSITION_LINK, std::string()); |
| 1725 if (IsBrowserSideNavigationEnabled()) | 1725 if (IsBrowserSideNavigationEnabled()) |
| 1726 rfh1->PrepareForCommit(); | 1726 rfh1->PrepareForCommit(); |
| 1727 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); | 1727 EXPECT_TRUE(contents()->CrossProcessNavigationPending()); |
| 1728 | 1728 |
| 1729 // Simulate the unresponsiveness timer. The tab should close. | 1729 // Simulate the unresponsiveness timer. The tab should close. |
| 1730 contents()->RendererUnresponsive( | 1730 rfh1->render_view_host()->ClosePageTimeout(); |
| 1731 rfh1->render_view_host()->GetWidget(), | |
| 1732 RendererUnresponsiveType::RENDERER_UNRESPONSIVE_CLOSE_PAGE); | |
| 1733 EXPECT_TRUE(close_delegate.is_closed()); | 1731 EXPECT_TRUE(close_delegate.is_closed()); |
| 1734 } | 1732 } |
| 1735 | 1733 |
| 1736 // Tests that the RenderFrameHost is properly deleted when the SwapOutACK is | 1734 // Tests that the RenderFrameHost is properly deleted when the SwapOutACK is |
| 1737 // received. (SwapOut and the corresponding ACK always occur after commit.) | 1735 // received. (SwapOut and the corresponding ACK always occur after commit.) |
| 1738 // Also tests that an early SwapOutACK is properly ignored. | 1736 // Also tests that an early SwapOutACK is properly ignored. |
| 1739 TEST_F(RenderFrameHostManagerTest, DeleteFrameAfterSwapOutACK) { | 1737 TEST_F(RenderFrameHostManagerTest, DeleteFrameAfterSwapOutACK) { |
| 1740 const GURL kUrl1("http://www.google.com/"); | 1738 const GURL kUrl1("http://www.google.com/"); |
| 1741 const GURL kUrl2("http://www.chromium.org/"); | 1739 const GURL kUrl2("http://www.chromium.org/"); |
| 1742 | 1740 |
| (...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3146 ASSERT_FALSE(delete_observer.deleted()); | 3144 ASSERT_FALSE(delete_observer.deleted()); |
| 3147 EXPECT_FALSE(initial_rfh->is_active()); | 3145 EXPECT_FALSE(initial_rfh->is_active()); |
| 3148 | 3146 |
| 3149 // The initial RFH receives a DidStartProvisionalLoad IPC. It should not | 3147 // The initial RFH receives a DidStartProvisionalLoad IPC. It should not |
| 3150 // create a NavigationHandle. | 3148 // create a NavigationHandle. |
| 3151 initial_rfh->SimulateNavigationStart(kUrl3); | 3149 initial_rfh->SimulateNavigationStart(kUrl3); |
| 3152 EXPECT_FALSE(initial_rfh->navigation_handle()); | 3150 EXPECT_FALSE(initial_rfh->navigation_handle()); |
| 3153 } | 3151 } |
| 3154 | 3152 |
| 3155 } // namespace content | 3153 } // namespace content |
| OLD | NEW |