summaryrefslogtreecommitdiffstats
path: root/content/shell/webkit_test_controller.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 20:50:58 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-08 20:50:58 +0000
commit20fbfc2ddfa29ca384c805fa7028a9a8b5040f0a (patch)
treefb0bb7e78b227cf0b1c5daafb037b90f5d69a614 /content/shell/webkit_test_controller.cc
parent27980b83cdd6c0c7c4c84345a18684ecede70dc5 (diff)
downloadchromium_src-20fbfc2ddfa29ca384c805fa7028a9a8b5040f0a.zip
chromium_src-20fbfc2ddfa29ca384c805fa7028a9a8b5040f0a.tar.gz
chromium_src-20fbfc2ddfa29ca384c805fa7028a9a8b5040f0a.tar.bz2
[content shell] forcibly resize webview before each test
Since we short-circuit resize requests during layout tests, the browser does not necessarily know the current size of the WebView, and so requesting a resize from the browser process might be ignored, because the RWHV thinks that it already has the correct size. BUG=111316 TEST=mac bot magically becomes non-flaky R=marja@chromium.org, piman@chromium.org Review URL: https://codereview.chromium.org/15027006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/webkit_test_controller.cc')
-rw-r--r--content/shell/webkit_test_controller.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc
index e1d8045..a8bb5bb 100644
--- a/content/shell/webkit_test_controller.cc
+++ b/content/shell/webkit_test_controller.cc
@@ -210,17 +210,17 @@ bool WebKitTestController::PrepareForLayoutTest(
ShellContentBrowserClient::Get()->browser_context();
if (test_url.spec().find("compositing/") != std::string::npos)
is_compositing_test_ = true;
- gfx::Size initial_size(kTestWindowWidthDip, kTestWindowHeightDip);
+ initial_size_ = gfx::Size(kTestWindowWidthDip, kTestWindowHeightDip);
// The W3C SVG layout tests use a different size than the other layout tests.
if (test_url.spec().find("W3C-SVG-1.1") != std::string::npos)
- initial_size = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip);
+ initial_size_ = gfx::Size(kTestSVGWindowWidthDip, kTestSVGWindowHeightDip);
if (!main_window_) {
main_window_ = content::Shell::CreateNewWindow(
browser_context,
GURL(),
NULL,
MSG_ROUTING_NONE,
- initial_size);
+ initial_size_);
WebContentsObserver::Observe(main_window_->web_contents());
send_configuration_to_next_host_ = true;
current_pid_ = base::kNullProcessId;
@@ -228,10 +228,10 @@ bool WebKitTestController::PrepareForLayoutTest(
} else {
#if (defined(OS_WIN) && !defined(USE_AURA)) || defined(TOOLKIT_GTK)
// Shell::SizeTo is not implemented on all platforms.
- main_window_->SizeTo(initial_size.width(), initial_size.height());
+ main_window_->SizeTo(initial_size_.width(), initial_size_.height());
#endif
main_window_->web_contents()->GetRenderViewHost()->GetView()
- ->SetSize(initial_size);
+ ->SetSize(initial_size_);
main_window_->web_contents()->GetRenderViewHost()->WasResized();
RenderViewHost* render_view_host =
main_window_->web_contents()->GetRenderViewHost();
@@ -448,6 +448,7 @@ void WebKitTestController::SendTestConfiguration() {
params.allow_external_pages = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowExternalPages);
params.expected_pixel_hash = expected_pixel_hash_;
+ params.initial_size = initial_size_;
render_view_host->Send(new ShellViewMsg_SetTestConfiguration(
render_view_host->GetRoutingID(), params));
}