| OLD | NEW |
| 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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 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 #if defined(OS_ANDROID) |
| 1513 host_->WasShown(ui::LatencyInfo()); |
| 1514 |
| 1515 ASSERT_FALSE(host_->is_hidden()); |
| 1516 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
| 1517 ASSERT_TRUE(host_->is_hidden()); |
| 1518 #else |
| 1512 host_->WasHidden(); | 1519 host_->WasHidden(); |
| 1513 | 1520 |
| 1514 ASSERT_TRUE(host_->is_hidden()); | 1521 ASSERT_TRUE(host_->is_hidden()); |
| 1515 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); | 1522 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
| 1516 ASSERT_FALSE(host_->is_hidden()); | 1523 ASSERT_FALSE(host_->is_hidden()); |
| 1524 #endif |
| 1517 | 1525 |
| 1518 // Make sure the input router is in a fresh state. | 1526 // Make sure the input router is in a fresh state. |
| 1519 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); | 1527 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); |
| 1520 } | 1528 } |
| 1521 | 1529 |
| 1522 TEST_F(RenderWidgetHostTest, ResizeParams) { | 1530 TEST_F(RenderWidgetHostTest, ResizeParams) { |
| 1523 gfx::Rect bounds(0, 0, 100, 100); | 1531 gfx::Rect bounds(0, 0, 100, 100); |
| 1524 gfx::Size physical_backing_size(40, 50); | 1532 gfx::Size physical_backing_size(40, 50); |
| 1525 view_->set_bounds(bounds); | 1533 view_->set_bounds(bounds); |
| 1526 view_->SetMockPhysicalBackingSize(physical_backing_size); | 1534 view_->SetMockPhysicalBackingSize(physical_backing_size); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1548 // Having an initial size set means that the size information had been sent | 1556 // 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 | 1557 // 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). | 1558 // calls should not result in new IPC (unless the size has actually changed). |
| 1551 host_->WasResized(); | 1559 host_->WasResized(); |
| 1552 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); | 1560 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); |
| 1553 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size); | 1561 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size); |
| 1554 EXPECT_TRUE(host_->resize_ack_pending_); | 1562 EXPECT_TRUE(host_->resize_ack_pending_); |
| 1555 } | 1563 } |
| 1556 | 1564 |
| 1557 } // namespace content | 1565 } // namespace content |
| OLD | NEW |