Fix hang in fast/frames/frame-display-none-focus.html during Gtk layout tests.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 11:35:47 +0000 (11:35 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 6 Jan 2008 11:35:47 +0000 (11:35 +0000)
Reviewed by Alp Toker.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(processWork): Process pending work.
(webViewLoadFinished): Schedule processing of pending work.
* DumpRenderTree/gtk/WorkQueueItemGtk.cpp: Use webkit_web_frame_reload.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp

index ce2192b..36a606b 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-05  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Alp Toker.
+
+        Fix hang in fast/frames/frame-display-none-focus.html during Gtk layout tests.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (processWork): Process pending work.
+        (webViewLoadFinished): Schedule processing of pending work.
+        * DumpRenderTree/gtk/WorkQueueItemGtk.cpp: Use webkit_web_frame_reload.
+
 2008-01-05  Darin Adler  <darin@apple.com>
 
         * Scripts/do-webcore-rename: Some more renaming plans.
index 53d329b..73a25f7 100644 (file)
@@ -39,6 +39,8 @@
 #include <JavaScriptCore/JSStringRef.h>
 #include <JavaScriptCore/JSValueRef.h>
 
+#include <wtf/Assertions.h>
+
 #include <cassert>
 #include <getopt.h>
 #include <stdlib.h>
@@ -240,6 +242,23 @@ void webViewLoadStarted(WebKitWebView* view, WebKitWebFrame* frame, void*)
         topLoadingFrame = frame;
 }
 
+static gboolean processWork(void* data)
+{
+    // quit doing work once a load is in progress
+    while (WorkQueue::shared()->count() > 0 && !topLoadingFrame) {
+        WorkQueueItem* item = WorkQueue::shared()->dequeue();
+        ASSERT(item);
+        item->invoke();
+        delete item;
+    }
+
+    // if we didn't start a new load, then we finished all the commands, so we're ready to dump state
+    if (!topLoadingFrame && !layoutTestController->waitToDump())
+        dump();
+
+    return FALSE;
+}
+
 void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
 {
     if (frame != topLoadingFrame)
@@ -251,7 +270,7 @@ void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
         return;
 
     if (WorkQueue::shared()->count())
-        fprintf(stderr, "FIXME: [self performSelector:@selector(processWork:) withObject:nil afterDelay:0];\n");
+        g_timeout_add(0, processWork, 0);
      else
         dump();
 }
index e81b610..f47e021 100644 (file)
@@ -56,9 +56,7 @@ void LoadItem::invoke() const
 
 void ReloadItem::invoke() const
 {
-    // TODO: Why not just reload the frame?
-    WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
-    webkit_web_view_reload(webView);
+    webkit_web_frame_reload(mainFrame);
 }
 
 void ScriptItem::invoke() const