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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 2857693002: DO NOT SUBMIT: Testing frame crash+renavigate that results in painting trouble.
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index fdf7ab570a71aca6ab23acee05238327fdda4a6a..237f5378f29eb5b7d4a6442377bf38e32a876c1c 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -8712,12 +8712,30 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// Crash the subframe process.
RenderProcessHost* child_process = child->current_frame_host()->GetProcess();
+ LOG(ERROR) << "; child_process->GetHandle() = " << child_process->GetHandle();
+
+ {
+ LOG(ERROR) << "Sleeping 10 seconds";
+ scoped_refptr<MessageLoopRunner> runner(new MessageLoopRunner());
+ base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, runner->QuitClosure(), base::TimeDelta::FromSeconds(10));
+ runner->Run();
+ }
+
RenderProcessHostWatcher crash_observer(
child_process, RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
child_process->Shutdown(0, false);
crash_observer.Wait();
EXPECT_FALSE(child->current_frame_host()->IsRenderFrameLive());
+ {
+ LOG(ERROR) << "Sleeping 10 seconds";
+ scoped_refptr<MessageLoopRunner> runner(new MessageLoopRunner());
+ base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, runner->QuitClosure(), base::TimeDelta::FromSeconds(10));
+ runner->Run();
+ }
+
// When the subframe dies, its RenderWidgetHostView should be cleared and
// reset in the CrossProcessFrameConnector.
EXPECT_FALSE(child->current_frame_host()->GetView());
@@ -8729,8 +8747,12 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
// Navigate the subframe to the same site it was on before crashing. This
// should reuse the subframe's current RenderFrameHost and reinitialize the
// RenderFrame in a new process.
- NavigateFrameToURL(child,
- embedded_test_server()->GetURL("b.com", "/title1.html"));
+ TestFrameNavigationObserver child_navigation_observer(child);
+ EXPECT_TRUE(
+ ExecuteScript(root->current_frame_host(),
+ "var f = document.getElementsByTagName('iframe')[0];\n"
+ "f.src = f.src\n"));
+ child_navigation_observer.Wait();
EXPECT_TRUE(child->current_frame_host()->IsRenderFrameLive());
// The RenderWidgetHostView for the child should be recreated and set to be
@@ -8748,6 +8770,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
EXPECT_TRUE(ExecuteScript(child->current_frame_host(),
"parent.postMessage('I am alive!', '*');"));
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
+
+ LOG(ERROR) << "Starting message loop for interactive UI...";
+ (new content::MessageLoopRunner)->Run();
}
// Test that session history length and offset are replicated to all renderer
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698