From 79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 25 Jun 2012 13:35:59 +0200 Subject: Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147) New snapshot that includes Win32 debug build fix (use SVGAllInOne) --- .../UIProcess/API/gtk/tests/WebViewTest.cpp | 26 ++++++++++++++++------ 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp') diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp index e355f786d..321b6a37a 100644 --- a/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp +++ b/Source/WebKit2/UIProcess/API/gtk/tests/WebViewTest.cpp @@ -43,12 +43,6 @@ WebViewTest::~WebViewTest() g_main_loop_unref(m_mainLoop); } -static gboolean testLoadTimeoutFinishLoop(GMainLoop* loop) -{ - g_main_loop_quit(loop); - return FALSE; -} - void WebViewTest::loadURI(const char* uri) { m_activeURI = uri; @@ -112,9 +106,27 @@ void WebViewTest::goToBackForwardListItem(WebKitBackForwardListItem* item) webkit_web_view_go_to_back_forward_list_item(m_webView, item); } +void WebViewTest::quitMainLoop() +{ + g_main_loop_quit(m_mainLoop); +} + +void WebViewTest::quitMainLoopAfterProcessingPendingEvents() +{ + while (gtk_events_pending()) + gtk_main_iteration(); + quitMainLoop(); +} + +static gboolean quitMainLoopIdleCallback(WebViewTest* test) +{ + test->quitMainLoop(); + return FALSE; +} + void WebViewTest::wait(double seconds) { - g_timeout_add_seconds(seconds, reinterpret_cast(testLoadTimeoutFinishLoop), m_mainLoop); + g_timeout_add_seconds(seconds, reinterpret_cast(quitMainLoopIdleCallback), this); g_main_loop_run(m_mainLoop); } -- cgit v1.2.1