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

Side by Side Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 1308623003: Assume crashed RenderWidgetHost to be invisible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check dest_render_frame_host->render_view_host()->is_hidden() Created 5 years, 3 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 1498
1499 TEST_F(RenderWidgetHostTest, RendererExitedResetsInputRouter) { 1499 TEST_F(RenderWidgetHostTest, RendererExitedResetsInputRouter) {
1500 // RendererExited will delete the view. 1500 // RendererExited will delete the view.
1501 host_->SetView(new TestView(host_.get())); 1501 host_->SetView(new TestView(host_.get()));
1502 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); 1502 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
1503 1503
1504 // Make sure the input router is in a fresh state. 1504 // Make sure the input router is in a fresh state.
1505 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); 1505 ASSERT_FALSE(host_->input_router()->HasPendingEvents());
1506 } 1506 }
1507 1507
1508 // Regression test for http://crbug.com/401859. 1508 // Regression test for http://crbug.com/401859 and http://crbug.com/522795.
1509 TEST_F(RenderWidgetHostTest, RendererExitedResetsIsHidden) { 1509 TEST_F(RenderWidgetHostTest, RendererExitedResetsIsHidden) {
1510 // RendererExited will delete the view. 1510 // RendererExited will delete the view.
1511 host_->SetView(new TestView(host_.get())); 1511 host_->SetView(new TestView(host_.get()));
1512 host_->WasHidden(); 1512 host_->WasShown(ui::LatencyInfo());
1513 1513
1514 ASSERT_FALSE(host_->is_hidden());
1515 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
1514 ASSERT_TRUE(host_->is_hidden()); 1516 ASSERT_TRUE(host_->is_hidden());
1515 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
1516 ASSERT_FALSE(host_->is_hidden());
1517 1517
1518 // Make sure the input router is in a fresh state. 1518 // Make sure the input router is in a fresh state.
1519 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); 1519 ASSERT_FALSE(host_->input_router()->HasPendingEvents());
1520 } 1520 }
1521 1521
1522 TEST_F(RenderWidgetHostTest, ResizeParams) { 1522 TEST_F(RenderWidgetHostTest, ResizeParams) {
1523 gfx::Rect bounds(0, 0, 100, 100); 1523 gfx::Rect bounds(0, 0, 100, 100);
1524 gfx::Size physical_backing_size(40, 50); 1524 gfx::Size physical_backing_size(40, 50);
1525 view_->set_bounds(bounds); 1525 view_->set_bounds(bounds);
1526 view_->SetMockPhysicalBackingSize(physical_backing_size); 1526 view_->SetMockPhysicalBackingSize(physical_backing_size);
(...skipping 21 matching lines...) Expand all
1548 // Having an initial size set means that the size information had been sent 1548 // Having an initial size set means that the size information had been sent
1549 // with the reqiest to new up the RenderView and so subsequent WasResized 1549 // with the reqiest to new up the RenderView and so subsequent WasResized
1550 // calls should not result in new IPC (unless the size has actually changed). 1550 // calls should not result in new IPC (unless the size has actually changed).
1551 host_->WasResized(); 1551 host_->WasResized();
1552 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); 1552 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID));
1553 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size); 1553 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size);
1554 EXPECT_TRUE(host_->resize_ack_pending_); 1554 EXPECT_TRUE(host_->resize_ack_pending_);
1555 } 1555 }
1556 1556
1557 } // namespace content 1557 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698