Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_browsertest.cc

Issue 1851253002: Remove RFHM::IsPendingDeletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest fixes. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 TestFrameNavigationObserver commit_observer(root); 2390 TestFrameNavigationObserver commit_observer(root);
2391 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html")); 2391 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html"));
2392 commit_observer.WaitForCommit(); 2392 commit_observer.WaitForCommit();
2393 rfh_a->ResetSwapOutTimerForTesting(); 2393 rfh_a->ResetSwapOutTimerForTesting();
2394 EXPECT_NE(shell()->web_contents()->GetSiteInstance(), 2394 EXPECT_NE(shell()->web_contents()->GetSiteInstance(),
2395 new_shell->web_contents()->GetSiteInstance()); 2395 new_shell->web_contents()->GetSiteInstance());
2396 EXPECT_TRUE(root->render_manager()->GetRenderFrameProxyHost(site_instance_a)); 2396 EXPECT_TRUE(root->render_manager()->GetRenderFrameProxyHost(site_instance_a));
2397 2397
2398 // The previous RFH should still be pending deletion, as we wait for either 2398 // The previous RFH should still be pending deletion, as we wait for either
2399 // the SwapOut ACK or a timeout. 2399 // the SwapOut ACK or a timeout.
2400 ASSERT_TRUE(root->render_manager()->IsPendingDeletion(rfh_a)); 2400 ASSERT_TRUE(rfh_a->IsRenderFrameLive());
2401 ASSERT_TRUE(!rfh_a->IsRFHStateActive(rfh_a->rfh_state()));
alexmos 2016/04/06 00:26:33 nit: ASSERT_FALSE might be a bit more readable, he
2401 2402
2402 // The corresponding RVH should not be pending deletion due to the proxy. 2403 // The corresponding RVH should not be pending deletion due to the proxy.
2403 EXPECT_FALSE(root->render_manager()->IsViewPendingDeletion( 2404 EXPECT_FALSE(root->render_manager()->IsViewPendingDeletion(
2404 rfh_a->render_view_host())); 2405 rfh_a->render_view_host()));
2405 2406
2406 // Kill the old process. 2407 // Kill the old process.
2407 RenderProcessHost* process = rfh_a->GetProcess(); 2408 RenderProcessHost* process = rfh_a->GetProcess();
2408 RenderProcessHostWatcher crash_observer( 2409 RenderProcessHostWatcher crash_observer(
2409 process, RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); 2410 process, RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
2410 process->Shutdown(0, false); 2411 process->Shutdown(0, false);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2447 RenderFrameHostImpl* rfh_a = root->current_frame_host(); 2448 RenderFrameHostImpl* rfh_a = root->current_frame_host();
2448 SiteInstanceImpl* site_instance_a = rfh_a->GetSiteInstance(); 2449 SiteInstanceImpl* site_instance_a = rfh_a->GetSiteInstance();
2449 TestFrameNavigationObserver commit_observer(root); 2450 TestFrameNavigationObserver commit_observer(root);
2450 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html")); 2451 shell()->LoadURL(embedded_test_server()->GetURL("b.com", "/title2.html"));
2451 commit_observer.WaitForCommit(); 2452 commit_observer.WaitForCommit();
2452 rfh_a->ResetSwapOutTimerForTesting(); 2453 rfh_a->ResetSwapOutTimerForTesting();
2453 EXPECT_NE(site_instance_a, shell()->web_contents()->GetSiteInstance()); 2454 EXPECT_NE(site_instance_a, shell()->web_contents()->GetSiteInstance());
2454 2455
2455 // The previous RFH and RVH should still be pending deletion, as we wait for 2456 // The previous RFH and RVH should still be pending deletion, as we wait for
2456 // either the SwapOut ACK or a timeout. 2457 // either the SwapOut ACK or a timeout.
2457 ASSERT_TRUE(root->render_manager()->IsPendingDeletion(rfh_a)); 2458 ASSERT_TRUE(rfh_a->IsRenderFrameLive());
2459 ASSERT_TRUE(!rfh_a->IsRFHStateActive(rfh_a->rfh_state()));
2458 EXPECT_TRUE(root->render_manager()->IsViewPendingDeletion( 2460 EXPECT_TRUE(root->render_manager()->IsViewPendingDeletion(
2459 rfh_a->render_view_host())); 2461 rfh_a->render_view_host()));
2460 2462
2461 // Open a popup in the new B process. 2463 // Open a popup in the new B process.
2462 Shell* new_shell = 2464 Shell* new_shell =
2463 OpenPopup(shell()->web_contents(), GURL(url::kAboutBlankURL), "foo"); 2465 OpenPopup(shell()->web_contents(), GURL(url::kAboutBlankURL), "foo");
2464 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(), 2466 EXPECT_EQ(shell()->web_contents()->GetSiteInstance(),
2465 new_shell->web_contents()->GetSiteInstance()); 2467 new_shell->web_contents()->GetSiteInstance());
2466 2468
2467 // Navigate the popup to the original site, but don't wait for commit (which 2469 // 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
2542 web_contents->GetRenderManagerForTesting()->speculative_frame_host()); 2544 web_contents->GetRenderManagerForTesting()->speculative_frame_host());
2543 } else { 2545 } else {
2544 EXPECT_FALSE( 2546 EXPECT_FALSE(
2545 web_contents->GetRenderManagerForTesting()->pending_frame_host()); 2547 web_contents->GetRenderManagerForTesting()->pending_frame_host());
2546 } 2548 }
2547 2549
2548 ResourceDispatcherHost::Get()->SetDelegate(nullptr); 2550 ResourceDispatcherHost::Get()->SetDelegate(nullptr);
2549 } 2551 }
2550 2552
2551 } // namespace content 2553 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698