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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2400 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html")); | 2400 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html")); |
2401 commit_observer.WaitForCommit(); | 2401 commit_observer.WaitForCommit(); |
2402 rfh_a->ResetSwapOutTimerForTesting(); | 2402 rfh_a->ResetSwapOutTimerForTesting(); |
2403 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), | 2403 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), |
2404 new_shell->web_contents()->GetSiteInstance()); | 2404 new_shell->web_contents()->GetSiteInstance()); |
2405 EXPECT_TRUE(root->render_manager()->GetRenderFrameProxyHost(site_instance_a)); | 2405 EXPECT_TRUE(root->render_manager()->GetRenderFrameProxyHost(site_instance_a)); |
2406 | 2406 |
2407 // The previous RFH should still be pending deletion, as we wait for either | 2407 // The previous RFH should still be pending deletion, as we wait for either |
2408 // the SwapOut ACK or a timeout. | 2408 // the SwapOut ACK or a timeout. |
2409 ASSERT_TRUE(rfh_a->IsRenderFrameLive()); | 2409 ASSERT_TRUE(rfh_a->IsRenderFrameLive()); |
2410 ASSERT_FALSE(rfh_a->IsRFHStateActive(rfh_a->rfh_state())); | 2410 ASSERT_FALSE(rfh_a->is_active()); |
2411 | 2411 |
2412 // The corresponding RVH should not be pending deletion due to the proxy. | 2412 // The corresponding RVH should not be pending deletion due to the proxy. |
2413 EXPECT_FALSE(root->render_manager()->IsViewPendingDeletion( | 2413 EXPECT_FALSE(root->render_manager()->IsViewPendingDeletion( |
2414 rfh_a->render_view_host())); | 2414 rfh_a->render_view_host())); |
2415 | 2415 |
2416 // Kill the old process. | 2416 // Kill the old process. |
2417 RenderProcessHost* process = rfh_a->GetProcess(); | 2417 RenderProcessHost* process = rfh_a->GetProcess(); |
2418 RenderProcessHostWatcher crash_observer( | 2418 RenderProcessHostWatcher crash_observer( |
2419 process, RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); | 2419 process, RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); |
2420 process->Shutdown(0, false); | 2420 process->Shutdown(0, false); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2458 SiteInstanceImpl* site_instance_a = rfh_a->GetSiteInstance(); | 2458 SiteInstanceImpl* site_instance_a = rfh_a->GetSiteInstance(); |
2459 TestFrameNavigationObserver commit_observer(root); | 2459 TestFrameNavigationObserver commit_observer(root); |
2460 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html")); | 2460 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html")); |
2461 commit_observer.WaitForCommit(); | 2461 commit_observer.WaitForCommit(); |
2462 rfh_a->ResetSwapOutTimerForTesting(); | 2462 rfh_a->ResetSwapOutTimerForTesting(); |
2463 EXPECT_NE(site_instance_a, shell()->web_contents()->GetSiteInstance()); | 2463 EXPECT_NE(site_instance_a, shell()->web_contents()->GetSiteInstance()); |
2464 | 2464 |
2465 // The previous RFH and RVH should still be pending deletion, as we wait for | 2465 // The previous RFH and RVH should still be pending deletion, as we wait for |
2466 // either the SwapOut ACK or a timeout. | 2466 // either the SwapOut ACK or a timeout. |
2467 ASSERT_TRUE(rfh_a->IsRenderFrameLive()); | 2467 ASSERT_TRUE(rfh_a->IsRenderFrameLive()); |
2468 ASSERT_FALSE(rfh_a->IsRFHStateActive(rfh_a->rfh_state())); | 2468 ASSERT_FALSE(rfh_a->is_active()); |
2469 EXPECT_TRUE(root->render_manager()->IsViewPendingDeletion( | 2469 EXPECT_TRUE(root->render_manager()->IsViewPendingDeletion( |
2470 rfh_a->render_view_host())); | 2470 rfh_a->render_view_host())); |
2471 | 2471 |
2472 // Open a popup in the new B process. | 2472 // Open a popup in the new B process. |
2473 Shell* new_shell = | 2473 Shell* new_shell = |
2474 OpenPopup(shell()->web_contents(), GURL(url::kAboutBlankURL), "foo"); | 2474 OpenPopup(shell()->web_contents(), GURL(url::kAboutBlankURL), "foo"); |
2475 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), | 2475 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), |
2476 new_shell->web_contents()->GetSiteInstance()); | 2476 new_shell->web_contents()->GetSiteInstance()); |
2477 | 2477 |
2478 // Navigate the popup to the original site, but don't wait for commit (which | 2478 // Navigate the popup to the original site, but don't wait for commit (which |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2553 web_contents->GetRenderManagerForTesting()->speculative_frame_host()); | 2553 web_contents->GetRenderManagerForTesting()->speculative_frame_host()); |
2554 } else { | 2554 } else { |
2555 EXPECT_FALSE( | 2555 EXPECT_FALSE( |
2556 web_contents->GetRenderManagerForTesting()->pending_frame_host()); | 2556 web_contents->GetRenderManagerForTesting()->pending_frame_host()); |
2557 } | 2557 } |
2558 | 2558 |
2559 ResourceDispatcherHost::Get()->SetDelegate(nullptr); | 2559 ResourceDispatcherHost::Get()->SetDelegate(nullptr); |
2560 } | 2560 } |
2561 | 2561 |
2562 } // namespace content | 2562 } // namespace content |
OLD | NEW |