| Index: content/public/test/render_widget_test.cc
|
| diff --git a/content/public/test/render_widget_test.cc b/content/public/test/render_widget_test.cc
|
| index 6bb7014542b5cea2bc9283b0ad8a5642293c3554..1e9bd6ea0a7470b972c43747e49d5ad77e3a4557 100644
|
| --- a/content/public/test/render_widget_test.cc
|
| +++ b/content/public/test/render_widget_test.cc
|
| @@ -5,20 +5,7 @@
|
| #include "content/public/test/render_widget_test.h"
|
|
|
| #include "base/basictypes.h"
|
| -#include "base/files/file_path.h"
|
| -#include "base/files/file_util.h"
|
| -#include "base/memory/ref_counted_memory.h"
|
| -#include "base/strings/stringprintf.h"
|
| -#include "content/common/view_messages.h"
|
| #include "content/renderer/render_view_impl.h"
|
| -#include "testing/gtest/include/gtest/gtest.h"
|
| -#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
|
| -#include "third_party/WebKit/public/platform/WebSize.h"
|
| -#include "third_party/WebKit/public/web/WebView.h"
|
| -#include "third_party/skia/include/core/SkBitmap.h"
|
| -#include "ui/gfx/codec/jpeg_codec.h"
|
| -#include "ui/gfx/geometry/size.h"
|
| -#include "ui/surface/transport_dib.h"
|
|
|
| namespace content {
|
|
|
| @@ -33,59 +20,16 @@ const uint32 RenderWidgetTest::kRedARGB = 0xFFFF0000;
|
|
|
| RenderWidgetTest::RenderWidgetTest() {}
|
|
|
| -void RenderWidgetTest::TestOnResize() {
|
| - RenderWidget* widget = static_cast<RenderViewImpl*>(view_);
|
| -
|
| - // The initial bounds is empty, so setting it to the same thing should do
|
| - // nothing.
|
| - ViewMsg_Resize_Params resize_params;
|
| - resize_params.screen_info = blink::WebScreenInfo();
|
| - resize_params.new_size = gfx::Size();
|
| - resize_params.physical_backing_size = gfx::Size();
|
| - resize_params.top_controls_height = 0.f;
|
| - resize_params.top_controls_shrink_blink_size = false;
|
| - resize_params.resizer_rect = gfx::Rect();
|
| - resize_params.is_fullscreen = false;
|
| - widget->OnResize(resize_params);
|
| - EXPECT_FALSE(widget->next_paint_is_resize_ack());
|
| -
|
| - // Setting empty physical backing size should not send the ack.
|
| - resize_params.new_size = gfx::Size(10, 10);
|
| - widget->OnResize(resize_params);
|
| - EXPECT_FALSE(widget->next_paint_is_resize_ack());
|
| -
|
| - // Setting the bounds to a "real" rect should send the ack.
|
| - render_thread_->sink().ClearMessages();
|
| - gfx::Size size(100, 100);
|
| - resize_params.new_size = size;
|
| - resize_params.physical_backing_size = size;
|
| - widget->OnResize(resize_params);
|
| - EXPECT_TRUE(widget->next_paint_is_resize_ack());
|
| -
|
| - // Clear the flag.
|
| - // TODO(danakj): How real is this test any more? This flag is only existing
|
| - // for DCHECKs now.
|
| - widget->didCompleteSwapBuffers();
|
| -
|
| - // Setting the same size again should not send the ack.
|
| - widget->OnResize(resize_params);
|
| - EXPECT_FALSE(widget->next_paint_is_resize_ack());
|
| -
|
| - // Resetting the rect to empty should not send the ack.
|
| - resize_params.new_size = gfx::Size();
|
| - resize_params.physical_backing_size = gfx::Size();
|
| - widget->OnResize(resize_params);
|
| - EXPECT_FALSE(widget->next_paint_is_resize_ack());
|
| +RenderWidget* RenderWidgetTest::widget() {
|
| + return static_cast<RenderViewImpl*>(view_);
|
| +}
|
|
|
| - // Changing the screen info should not send the ack.
|
| - resize_params.screen_info.orientationAngle = 90;
|
| - widget->OnResize(resize_params);
|
| - EXPECT_FALSE(widget->next_paint_is_resize_ack());
|
| +void RenderWidgetTest::OnResize(const ViewMsg_Resize_Params& params) {
|
| + widget()->OnResize(params);
|
| +}
|
|
|
| - resize_params.screen_info.orientationType =
|
| - blink::WebScreenOrientationPortraitPrimary;
|
| - widget->OnResize(resize_params);
|
| - EXPECT_FALSE(widget->next_paint_is_resize_ack());
|
| +bool RenderWidgetTest::next_paint_is_resize_ack() {
|
| + return widget()->next_paint_is_resize_ack();
|
| }
|
|
|
| } // namespace content
|
|
|