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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 host_->GetResizeParams(&resize_params); | 1445 host_->GetResizeParams(&resize_params); |
1446 EXPECT_EQ(bounds.size(), resize_params.new_size); | 1446 EXPECT_EQ(bounds.size(), resize_params.new_size); |
1447 EXPECT_EQ(physical_backing_size, resize_params.physical_backing_size); | 1447 EXPECT_EQ(physical_backing_size, resize_params.physical_backing_size); |
1448 } | 1448 } |
1449 | 1449 |
1450 class RenderWidgetHostInitialSizeTest : public RenderWidgetHostTest { | 1450 class RenderWidgetHostInitialSizeTest : public RenderWidgetHostTest { |
1451 public: | 1451 public: |
1452 RenderWidgetHostInitialSizeTest() | 1452 RenderWidgetHostInitialSizeTest() |
1453 : RenderWidgetHostTest(), initial_size_(200, 100) {} | 1453 : RenderWidgetHostTest(), initial_size_(200, 100) {} |
1454 | 1454 |
1455 virtual void ConfigureView(TestView* view) override { | 1455 void ConfigureView(TestView* view) override { |
1456 view->set_bounds(gfx::Rect(initial_size_)); | 1456 view->set_bounds(gfx::Rect(initial_size_)); |
1457 } | 1457 } |
1458 | 1458 |
1459 protected: | 1459 protected: |
1460 gfx::Size initial_size_; | 1460 gfx::Size initial_size_; |
1461 }; | 1461 }; |
1462 | 1462 |
1463 TEST_F(RenderWidgetHostInitialSizeTest, InitialSize) { | 1463 TEST_F(RenderWidgetHostInitialSizeTest, InitialSize) { |
1464 // Having an initial size set means that the size information had been sent | 1464 // Having an initial size set means that the size information had been sent |
1465 // with the reqiest to new up the RenderView and so subsequent WasResized | 1465 // with the reqiest to new up the RenderView and so subsequent WasResized |
1466 // calls should not result in new IPC (unless the size has actually changed). | 1466 // calls should not result in new IPC (unless the size has actually changed). |
1467 host_->WasResized(); | 1467 host_->WasResized(); |
1468 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); | 1468 EXPECT_FALSE(process_->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID)); |
1469 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size); | 1469 EXPECT_EQ(initial_size_, host_->old_resize_params_->new_size); |
1470 EXPECT_TRUE(host_->resize_ack_pending_); | 1470 EXPECT_TRUE(host_->resize_ack_pending_); |
1471 } | 1471 } |
1472 | 1472 |
1473 } // namespace content | 1473 } // namespace content |
OLD | NEW |