| 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 "content/common/view_messages.h" | 5 #include "content/common/view_messages.h" |
| 6 #include "content/public/test/render_widget_test.h" | 6 #include "content/public/test/render_widget_test.h" |
| 7 #include "content/renderer/render_widget.h" | 7 #include "content/renderer/render_widget.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // Setting the bounds to a "real" rect should send the ack. | 31 // Setting the bounds to a "real" rect should send the ack. |
| 32 render_thread_->sink().ClearMessages(); | 32 render_thread_->sink().ClearMessages(); |
| 33 gfx::Size size(100, 100); | 33 gfx::Size size(100, 100); |
| 34 resize_params.new_size = size; | 34 resize_params.new_size = size; |
| 35 resize_params.physical_backing_size = size; | 35 resize_params.physical_backing_size = size; |
| 36 resize_params.needs_resize_ack = true; | 36 resize_params.needs_resize_ack = true; |
| 37 OnResize(resize_params); | 37 OnResize(resize_params); |
| 38 EXPECT_EQ(resize_params.needs_resize_ack, next_paint_is_resize_ack()); | 38 EXPECT_EQ(resize_params.needs_resize_ack, next_paint_is_resize_ack()); |
| 39 | 39 |
| 40 // Clear the flag. | 40 // Clear the flag. |
| 41 widget()->didCompleteSwapBuffers(); | 41 widget()->DidCompleteSwapBuffers(); |
| 42 | 42 |
| 43 // Setting the same size again should not send the ack. | 43 // Setting the same size again should not send the ack. |
| 44 resize_params.needs_resize_ack = false; | 44 resize_params.needs_resize_ack = false; |
| 45 OnResize(resize_params); | 45 OnResize(resize_params); |
| 46 EXPECT_EQ(resize_params.needs_resize_ack, next_paint_is_resize_ack()); | 46 EXPECT_EQ(resize_params.needs_resize_ack, next_paint_is_resize_ack()); |
| 47 | 47 |
| 48 // Resetting the rect to empty should not send the ack. | 48 // Resetting the rect to empty should not send the ack. |
| 49 resize_params.new_size = gfx::Size(); | 49 resize_params.new_size = gfx::Size(); |
| 50 resize_params.physical_backing_size = gfx::Size(); | 50 resize_params.physical_backing_size = gfx::Size(); |
| 51 OnResize(resize_params); | 51 OnResize(resize_params); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 TEST_F(RenderWidgetInitialSizeTest, InitialSize) { | 83 TEST_F(RenderWidgetInitialSizeTest, InitialSize) { |
| 84 EXPECT_EQ(initial_size_, widget()->size()); | 84 EXPECT_EQ(initial_size_, widget()->size()); |
| 85 EXPECT_EQ(initial_size_, gfx::Size(widget()->webwidget()->size())); | 85 EXPECT_EQ(initial_size_, gfx::Size(widget()->webwidget()->size())); |
| 86 EXPECT_TRUE(next_paint_is_resize_ack()); | 86 EXPECT_TRUE(next_paint_is_resize_ack()); |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 } // namespace content | 90 } // namespace content |
| OLD | NEW |