Commit cdb80672 authored by jochen@chromium.org's avatar jochen@chromium.org

[content shell] W3C SVG tests need to run in a smaller window

BUG=111316
TEST=W3C SVG tests pass
R=marja@chromium.org
TBR=jam@chromium.org


Review URL: https://chromiumcodereview.appspot.com/11828028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176068 0039d316-1c4b-4281-b951-d872f2087c98
parent 72030697
......@@ -57,7 +57,7 @@ void LaunchShell(JNIEnv* env, jclass clazz, jstring jurl) {
url,
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
}
} // namespace content
......@@ -29,7 +29,6 @@
#include "content/shell/shell_messages.h"
#include "content/shell/shell_switches.h"
#include "content/shell/webkit_test_controller.h"
#include "ui/gfx/size.h"
// Content area size for newly created windows.
static const int kTestWindowWidth = 800;
......@@ -121,15 +120,13 @@ Shell* Shell::CreateNewWindow(BrowserContext* browser_context,
const GURL& url,
SiteInstance* site_instance,
int routing_id,
WebContents* base_web_contents) {
const gfx::Size& initial_size) {
WebContents::CreateParams create_params(browser_context, site_instance);
create_params.routing_id = routing_id;
if (base_web_contents) {
create_params.initial_size =
base_web_contents->GetView()->GetContainerSize();
} else {
if (!initial_size.IsEmpty())
create_params.initial_size = initial_size;
else
create_params.initial_size = gfx::Size(kTestWindowWidth, kTestWindowHeight);
}
WebContents* web_contents = WebContents::Create(create_params);
Shell* shell = CreateShell(web_contents);
if (!url.is_empty())
......@@ -185,7 +182,7 @@ void Shell::ShowDevTools() {
DevToolsAgentHost::GetFor(web_contents()->GetRenderViewHost()));
dev_tools_ = CreateNewWindow(
web_contents()->GetBrowserContext(),
url, NULL, MSG_ROUTING_NONE, NULL);
url, NULL, MSG_ROUTING_NONE, gfx::Size());
}
void Shell::CloseDevTools() {
......
......@@ -17,6 +17,7 @@
#include "content/public/browser/web_contents_delegate.h"
#include "ipc/ipc_channel.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/size.h"
#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
......@@ -68,7 +69,7 @@ class Shell : public WebContentsDelegate,
const GURL& url,
SiteInstance* site_instance,
int routing_id,
WebContents* base_web_contents);
const gfx::Size& initial_size);
// Returns the Shell object corresponding to the given RenderViewHost.
static Shell* FromRenderViewHost(RenderViewHost* rvh);
......
......@@ -33,7 +33,7 @@
GURL("about:blank"),
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
}
@end
......@@ -134,7 +134,7 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
GetStartupURL(),
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
}
if (parameters_.ui_task) {
......
......@@ -69,7 +69,7 @@ RenderViewHost* ShellDevToolsDelegate::CreateNewTarget() {
GURL(chrome::kAboutBlankURL),
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
return shell->web_contents()->GetRenderViewHost();
}
......
......@@ -275,7 +275,7 @@ gboolean Shell::OnNewWindowKeyPressed(GtkAccelGroup* accel_group,
GURL(),
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
return TRUE;
}
......
......@@ -219,7 +219,7 @@ void ShellWebContentsViewDelegate::OnOpenURLMenuActivated(GtkWidget* widget) {
params_.link_url,
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
}
void ShellWebContentsViewDelegate::OnCutMenuActivated(GtkWidget* widget) {
......@@ -250,7 +250,7 @@ void ShellWebContentsViewDelegate::OnInspectMenuActivated(GtkWidget* widget) {
url,
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
}
} // namespace content
......@@ -245,7 +245,7 @@ void ShellWebContentsViewDelegate::ActionPerformed(int tag) {
params_.link_url,
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
break;
}
case ShellContextMenuItemBackTag:
......@@ -273,7 +273,7 @@ void ShellWebContentsViewDelegate::ActionPerformed(int tag) {
url,
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
break;
}
}
......
......@@ -213,7 +213,7 @@ void ShellWebContentsViewDelegate::MenuItemSelected(int selection) {
params_.link_url,
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
break;
}
case ShellContextMenuItemBackId:
......@@ -240,7 +240,7 @@ void ShellWebContentsViewDelegate::MenuItemSelected(int selection) {
url,
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
break;
}
}
......
......@@ -201,7 +201,7 @@ LRESULT CALLBACK Shell::WndProc(HWND hwnd, UINT message, WPARAM wParam,
case IDM_NEW_WINDOW:
CreateNewWindow(
shell->web_contents()->GetBrowserContext(),
GURL(), NULL, MSG_ROUTING_NONE, NULL);
GURL(), NULL, MSG_ROUTING_NONE, gfx::Size());
break;
case IDM_CLOSE_WINDOW:
DestroyWindow(hwnd);
......
......@@ -164,12 +164,16 @@ bool WebKitTestController::PrepareForLayoutTest(
content::ShellBrowserContext* browser_context =
static_cast<content::ShellContentBrowserClient*>(
content::GetContentClient()->browser())->browser_context();
gfx::Size initial_size;
// 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(480, 360);
main_window_ = content::Shell::CreateNewWindow(
browser_context,
GURL(),
NULL,
MSG_ROUTING_NONE,
NULL);
initial_size);
WebContentsObserver::Observe(main_window_->web_contents());
main_window_->LoadURL(test_url);
if (test_url.spec().find("/dumpAsText/") != std::string::npos ||
......
......@@ -138,7 +138,7 @@ Shell* ContentBrowserTest::CreateBrowser() {
GURL(chrome::kAboutBlankURL),
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
}
Shell* ContentBrowserTest::CreateOffTheRecordBrowser() {
......@@ -149,7 +149,7 @@ Shell* ContentBrowserTest::CreateOffTheRecordBrowser() {
GURL(chrome::kAboutBlankURL),
NULL,
MSG_ROUTING_NONE,
NULL);
gfx::Size());
}
} // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment