| 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/resize_params.h" | 5 #include "content/common/resize_params.h" |
| 6 #include "content/public/test/render_view_test.h" | 6 #include "content/public/test/render_view_test.h" |
| 7 #include "content/renderer/render_view_impl.h" | 7 #include "content/renderer/render_view_impl.h" |
| 8 #include "content/renderer/render_widget.h" | 8 #include "content/renderer/render_widget.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 class RenderWidgetTest : public RenderViewTest { | 12 class RenderWidgetTest : public RenderViewTest { |
| 13 protected: | 13 protected: |
| 14 RenderWidget* widget() { return view_->GetWidget(); } | 14 RenderWidget* widget() { |
| 15 return static_cast<RenderViewImpl*>(view_); |
| 16 } |
| 15 | 17 |
| 16 void OnResize(const ResizeParams& params) { | 18 void OnResize(const ResizeParams& params) { |
| 17 widget()->OnResize(params); | 19 widget()->OnResize(params); |
| 18 } | 20 } |
| 19 | 21 |
| 20 bool next_paint_is_resize_ack() { | 22 bool next_paint_is_resize_ack() { |
| 21 return widget()->next_paint_is_resize_ack(); | 23 return widget()->next_paint_is_resize_ack(); |
| 22 } | 24 } |
| 23 }; | 25 }; |
| 24 | 26 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 }; | 96 }; |
| 95 | 97 |
| 96 TEST_F(RenderWidgetInitialSizeTest, InitialSize) { | 98 TEST_F(RenderWidgetInitialSizeTest, InitialSize) { |
| 97 EXPECT_EQ(initial_size_, widget()->size()); | 99 EXPECT_EQ(initial_size_, widget()->size()); |
| 98 EXPECT_EQ(initial_size_, gfx::Size(widget()->webwidget()->size())); | 100 EXPECT_EQ(initial_size_, gfx::Size(widget()->webwidget()->size())); |
| 99 EXPECT_TRUE(next_paint_is_resize_ack()); | 101 EXPECT_TRUE(next_paint_is_resize_ack()); |
| 100 } | 102 } |
| 101 | 103 |
| 102 | 104 |
| 103 } // namespace content | 105 } // namespace content |
| OLD | NEW |