OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 4119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4130 GURL b_url(embedded_test_server()->GetURL("b.com", "/title2.html")); | 4130 GURL b_url(embedded_test_server()->GetURL("b.com", "/title2.html")); |
4131 TestFrameNavigationObserver commit_observer(root); | 4131 TestFrameNavigationObserver commit_observer(root); |
4132 shell()->LoadURL(b_url); | 4132 shell()->LoadURL(b_url); |
4133 commit_observer.WaitForCommit(); | 4133 commit_observer.WaitForCommit(); |
4134 EXPECT_FALSE(deleted_observer.deleted()); | 4134 EXPECT_FALSE(deleted_observer.deleted()); |
4135 rfh->ResetSwapOutTimerForTesting(); | 4135 rfh->ResetSwapOutTimerForTesting(); |
4136 | 4136 |
4137 // Since the SwapOut ACK for A->B is dropped, the first page's | 4137 // Since the SwapOut ACK for A->B is dropped, the first page's |
4138 // RenderFrameHost and RenderViewHost should be pending deletion after the | 4138 // RenderFrameHost and RenderViewHost should be pending deletion after the |
4139 // last navigation. | 4139 // last navigation. |
4140 EXPECT_TRUE(root->render_manager()->IsPendingDeletion(rfh)); | 4140 EXPECT_FALSE(rfh->IsRFHStateActive(rfh->rfh_state())); |
4141 EXPECT_TRUE(root->render_manager()->IsViewPendingDeletion(rvh)); | 4141 EXPECT_TRUE(root->render_manager()->IsViewPendingDeletion(rvh)); |
4142 | 4142 |
4143 // Wait for process A to exit so we can reinitialize it cleanly for the next | 4143 // Wait for process A to exit so we can reinitialize it cleanly for the next |
4144 // navigation. This can be removed once https://crbug.com/535246 is fixed. | 4144 // navigation. This can be removed once https://crbug.com/535246 is fixed. |
4145 RenderProcessHostWatcher process_exit_observer( | 4145 RenderProcessHostWatcher process_exit_observer( |
4146 rvh->GetProcess(), | 4146 rvh->GetProcess(), |
4147 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 4147 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
4148 process_exit_observer.Wait(); | 4148 process_exit_observer.Wait(); |
4149 | 4149 |
4150 // Start a navigation back to A and check that the RenderViewHost wasn't | 4150 // Start a navigation back to A and check that the RenderViewHost wasn't |
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6310 EXPECT_EQ(b_url, root->current_url()); | 6310 EXPECT_EQ(b_url, root->current_url()); |
6311 | 6311 |
6312 // Verify that the same RenderViewHost is preserved and that it is no longer | 6312 // Verify that the same RenderViewHost is preserved and that it is no longer |
6313 // in swapped out state. | 6313 // in swapped out state. |
6314 EXPECT_EQ(rvh, contents->GetFrameTree()->GetRenderViewHost( | 6314 EXPECT_EQ(rvh, contents->GetFrameTree()->GetRenderViewHost( |
6315 root->current_frame_host()->GetSiteInstance())); | 6315 root->current_frame_host()->GetSiteInstance())); |
6316 EXPECT_FALSE(rvh->is_swapped_out_); | 6316 EXPECT_FALSE(rvh->is_swapped_out_); |
6317 } | 6317 } |
6318 | 6318 |
6319 } // namespace content | 6319 } // namespace content |
OLD | NEW |