| 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 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); | 1496 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
| 1497 | 1497 |
| 1498 // Make sure the input router is in a fresh state. | 1498 // Make sure the input router is in a fresh state. |
| 1499 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); | 1499 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); |
| 1500 } | 1500 } |
| 1501 | 1501 |
| 1502 // Regression test for http://crbug.com/401859. | 1502 // Regression test for http://crbug.com/401859. |
| 1503 TEST_F(RenderWidgetHostTest, RendererExitedResetsIsHidden) { | 1503 TEST_F(RenderWidgetHostTest, RendererExitedResetsIsHidden) { |
| 1504 // RendererExited will delete the view. | 1504 // RendererExited will delete the view. |
| 1505 host_->SetView(new TestView(host_.get())); | 1505 host_->SetView(new TestView(host_.get())); |
| 1506 #if defined(OS_ANDROID) |
| 1507 host_->WasShown(ui::LatencyInfo()); |
| 1508 |
| 1509 ASSERT_FALSE(host_->is_hidden()); |
| 1510 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
| 1511 ASSERT_TRUE(host_->is_hidden()); |
| 1512 #else |
| 1506 host_->WasHidden(); | 1513 host_->WasHidden(); |
| 1507 | 1514 |
| 1508 ASSERT_TRUE(host_->is_hidden()); | 1515 ASSERT_TRUE(host_->is_hidden()); |
| 1509 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); | 1516 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); |
| 1510 ASSERT_FALSE(host_->is_hidden()); | 1517 ASSERT_FALSE(host_->is_hidden()); |
| 1518 #endif |
| 1511 | 1519 |
| 1512 // Make sure the input router is in a fresh state. | 1520 // Make sure the input router is in a fresh state. |
| 1513 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); | 1521 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); |
| 1514 } | 1522 } |
| 1515 | 1523 |
| 1516 TEST_F(RenderWidgetHostTest, ResizeParams) { | 1524 TEST_F(RenderWidgetHostTest, ResizeParams) { |
| 1517 gfx::Rect bounds(0, 0, 100, 100); | 1525 gfx::Rect bounds(0, 0, 100, 100); |
| 1518 gfx::Size physical_backing_size(40, 50); | 1526 gfx::Size physical_backing_size(40, 50); |
| 1519 view_->set_bounds(bounds); | 1527 view_->set_bounds(bounds); |
| 1520 view_->SetMockPhysicalBackingSize(physical_backing_size); | 1528 view_->SetMockPhysicalBackingSize(physical_backing_size); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1542 // Having an initial size set means that the size information had been sent | 1550 // Having an initial size set means that the size information had been sent |
| 1543 // with the reqiest to new up the RenderView and so subsequent WasResized | 1551 // with the reqiest to new up the RenderView and so subsequent WasResized |
| 1544 // calls should not result in new IPC (unless the size has actually changed). | 1552 // calls should not result in new IPC (unless the size has actually changed). |
| 1545 host_->WasResized(); | 1553 host_->WasResized(); |
| 1546 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); | 1554 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); |
| 1547 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size); | 1555 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size); |
| 1548 EXPECT_TRUE(host_->resize_ack_pending_); | 1556 EXPECT_TRUE(host_->resize_ack_pending_); |
| 1549 } | 1557 } |
| 1550 | 1558 |
| 1551 } // namespace content | 1559 } // namespace content |
| OLD | NEW |