Commit 7017a819 authored by ppi's avatar ppi Committed by Commit bot

Fix reload of a tab that crashed in background.

This patch fixes a trivial mistake that made the fix in
https://codereview.chromium.org/459613007 a noop, and adds a regression
unit-test.

BUG=401859

Review URL: https://codereview.chromium.org/498293002

Cr-Commit-Position: refs/heads/master@{#291765}
parent 0efb94f2
......@@ -1207,7 +1207,7 @@ void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status,
// We need to at least make sure that the RenderProcessHost is notified about
// the |is_hidden_| change, so that the renderer will have correct visibility
// set when respawned.
if (!is_hidden_) {
if (is_hidden_) {
process_->WidgetRestored();
is_hidden_ = false;
}
......
......@@ -1416,4 +1416,18 @@ TEST_F(RenderWidgetHostTest, RendererExitedResetsInputRouter) {
ASSERT_FALSE(host_->input_router()->HasPendingEvents());
}
// Regression test for http://crbug.com/401859.
TEST_F(RenderWidgetHostTest, RendererExitedResetsIsHidden) {
// RendererExited will delete the view.
host_->SetView(new TestView(host_.get()));
host_->WasHidden();
ASSERT_TRUE(host_->is_hidden());
host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
ASSERT_FALSE(host_->is_hidden());
// Make sure the input router is in a fresh state.
ASSERT_FALSE(host_->input_router()->HasPendingEvents());
}
} // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment