summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-25 15:09:11 +0200
commita89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (patch)
treeb7abd9f49ae1d4d2e426a5883bfccd42b8e2ee12 /Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
parent8d473cf9743f1d30a16a27114e93bd5af5648d23 (diff)
downloadqtwebkit-a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd.tar.gz
Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516)
Diffstat (limited to 'Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp')
-rw-r--r--Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
index 7a9e49bc6..e355f786d 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp
@@ -162,10 +162,10 @@ static gboolean parentWindowMapped(GtkWidget* widget, GdkEvent*, WebViewTest* te
return FALSE;
}
-void WebViewTest::showInWindowAndWaitUntilMapped()
+void WebViewTest::showInWindowAndWaitUntilMapped(GtkWindowType windowType)
{
g_assert(!m_parentWindow);
- m_parentWindow = gtk_window_new(GTK_WINDOW_POPUP);
+ m_parentWindow = gtk_window_new(windowType);
gtk_container_add(GTK_CONTAINER(m_parentWindow), GTK_WIDGET(m_webView));
gtk_widget_show(GTK_WIDGET(m_webView));
@@ -174,6 +174,17 @@ void WebViewTest::showInWindowAndWaitUntilMapped()
g_main_loop_run(m_mainLoop);
}
+void WebViewTest::resizeView(int width, int height)
+{
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(GTK_WIDGET(m_webView), &allocation);
+ if (width != -1)
+ allocation.width = width;
+ if (height != -1)
+ allocation.height = height;
+ gtk_widget_size_allocate(GTK_WIDGET(m_webView), &allocation);
+}
+
void WebViewTest::mouseMoveTo(int x, int y, unsigned int mouseModifiers)
{
g_assert(m_parentWindow);
@@ -268,7 +279,7 @@ WebKitJavascriptResult* WebViewTest::runJavaScriptAndWaitUntilFinished(const cha
webkit_javascript_result_unref(m_javascriptResult);
m_javascriptResult = 0;
m_javascriptError = error;
- webkit_web_view_run_javascript(m_webView, javascript, reinterpret_cast<GAsyncReadyCallback>(runJavaScriptReadyCallback), this);
+ webkit_web_view_run_javascript(m_webView, javascript, 0, reinterpret_cast<GAsyncReadyCallback>(runJavaScriptReadyCallback), this);
g_main_loop_run(m_mainLoop);
return m_javascriptResult;