Title: [94105] trunk
Revision
94105
Author
[email protected]
Date
2011-08-30 13:42:46 -0700 (Tue, 30 Aug 2011)

Log Message

Emit last progress notification before calling dispatchDidFinishLoad
https://bugs.webkit.org/show_bug.cgi?id=28851

Reviewed by Adam Barth.

Source/WebCore:

Original patch by Xan Lopez. Change FrameLoader to dispatch the notifications in
a more natural sequence.

Test: http/tests/loading/progress-finished-callback.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):

Source/WebKit/qt:

Add infrastructure to dump progressFinishedNotification callback in DRT.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::dumpProgressFinishedCallback):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
* WebCoreSupport/FrameLoaderClientQt.h:

Tools:

Implement dumpProgressFinishedCallback() in the layoutTestController for Qt,
Chromium and GTK ports. The first two were simple changes.

Some refactoring was needed in GTK port to assure that the dumps are emitted
correctly and the processing after the page load finished is in the right place.

To detect the load finished, we use the callback for the "load-status" notifier
signal of the top loading frame. And we use the deprecated "load-finished" signal
for dumping (if enabled) the progress finished expected output.

* DumpRenderTree/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(dumpProgressFinishedCallbackCallback):
(LayoutTestController::staticFunctions):
* DumpRenderTree/LayoutTestController.h:
(LayoutTestController::dumpProgressFinishedCallback):
(LayoutTestController::setDumpProgressFinishedCallback):
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::LayoutTestController):
(LayoutTestController::dumpProgressFinishedCallback):
(LayoutTestController::reset):
* DumpRenderTree/chromium/LayoutTestController.h:
(LayoutTestController::shouldDumpProgressFinishedCallback):
(LayoutTestController::setShouldDumpProgressFinishedCallback):
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::didStopLoading):
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(webViewLoadFinished):
(topLoadingFrameLoadFinished):
(webFrameLoadStatusNotified):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::reset):
(LayoutTestController::dumpProgressFinishedCallback):
* DumpRenderTree/qt/LayoutTestControllerQt.h:

LayoutTests:

Keep track of the order expected for the progressFinishedNotification, which is
before the didFinishLoadForFrame.

* http/tests/loading/progress-finished-callback-expected.txt: Added.
* http/tests/loading/progress-finished-callback.html: Added.
* platform/mac/Skipped:
* platform/win/Skipped:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94104 => 94105)


--- trunk/LayoutTests/ChangeLog	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/LayoutTests/ChangeLog	2011-08-30 20:42:46 UTC (rev 94105)
@@ -1,3 +1,18 @@
+2011-08-30  Caio Marcelo de Oliveira Filho  <[email protected]>
+
+        Emit last progress notification before calling dispatchDidFinishLoad
+        https://bugs.webkit.org/show_bug.cgi?id=28851
+
+        Reviewed by Adam Barth.
+
+        Keep track of the order expected for the progressFinishedNotification, which is
+        before the didFinishLoadForFrame.
+
+        * http/tests/loading/progress-finished-callback-expected.txt: Added.
+        * http/tests/loading/progress-finished-callback.html: Added.
+        * platform/mac/Skipped:
+        * platform/win/Skipped:
+
 2011-08-30  Ojan Vafai  <[email protected]>
 
         CSS parsing for -webkit-flex-flow

Added: trunk/LayoutTests/http/tests/loading/progress-finished-callback-expected.txt (0 => 94105)


--- trunk/LayoutTests/http/tests/loading/progress-finished-callback-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/loading/progress-finished-callback-expected.txt	2011-08-30 20:42:46 UTC (rev 94105)
@@ -0,0 +1,7 @@
+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+postProgressFinishedNotification
+main frame - didFinishLoadForFrame
+This is a test of progress finished callback ordering in relation to frame loader callbacks. It is only useful inside the regression test tool.

Added: trunk/LayoutTests/http/tests/loading/progress-finished-callback.html (0 => 94105)


--- trunk/LayoutTests/http/tests/loading/progress-finished-callback.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/loading/progress-finished-callback.html	2011-08-30 20:42:46 UTC (rev 94105)
@@ -0,0 +1,7 @@
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.dumpProgressFinishedCallback();
+}
+</script>
+This is a test of progress finished callback ordering in relation to frame loader callbacks. It is only useful inside the regression test tool.

Modified: trunk/LayoutTests/platform/mac/Skipped (94104 => 94105)


--- trunk/LayoutTests/platform/mac/Skipped	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/LayoutTests/platform/mac/Skipped	2011-08-30 20:42:46 UTC (rev 94105)
@@ -412,3 +412,6 @@
 # https://bugs.webkit.org/show_bug.cgi?id=66783
 # Makes subsequent test crash
 fast/loader/document-destruction-within-unload.html
+
+# https://bugs.webkit.org/show_bug.cgi?id=66772
+http/tests/loading/progress-finished-callback.html

Modified: trunk/LayoutTests/platform/win/Skipped (94104 => 94105)


--- trunk/LayoutTests/platform/win/Skipped	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/LayoutTests/platform/win/Skipped	2011-08-30 20:42:46 UTC (rev 94105)
@@ -1401,3 +1401,6 @@
 
 # Need DRT change: https://bugs.webkit.org/show_bug.cgi?id=66620
 editing/spelling/spelling-insert-html.html
+
+# https://bugs.webkit.org/show_bug.cgi?id=66773
+http/tests/loading/progress-finished-callback.html

Modified: trunk/Source/WebCore/ChangeLog (94104 => 94105)


--- trunk/Source/WebCore/ChangeLog	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Source/WebCore/ChangeLog	2011-08-30 20:42:46 UTC (rev 94105)
@@ -1,3 +1,18 @@
+2011-08-30  Caio Marcelo de Oliveira Filho  <[email protected]>
+
+        Emit last progress notification before calling dispatchDidFinishLoad
+        https://bugs.webkit.org/show_bug.cgi?id=28851
+
+        Reviewed by Adam Barth.
+
+        Original patch by Xan Lopez. Change FrameLoader to dispatch the notifications in
+        a more natural sequence.
+
+        Test: http/tests/loading/progress-finished-callback.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+
 2011-08-30  Ojan Vafai  <[email protected]>
 
         CSS parsing for -webkit-flex-flow

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (94104 => 94105)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -2292,14 +2292,15 @@
             if (m_stateMachine.creatingInitialEmptyDocument() || !m_stateMachine.committedFirstRealDocumentLoad())
                 return;
 
+            if (Page* page = m_frame->page())
+                page->progress()->progressCompleted(m_frame);
+
             const ResourceError& error = dl->mainDocumentError();
             if (!error.isNull())
                 m_client->dispatchDidFailLoad(error);
             else
                 m_client->dispatchDidFinishLoad();
 
-            if (Page* page = m_frame->page())
-                page->progress()->progressCompleted(m_frame);
             return;
         }
         

Modified: trunk/Source/WebKit/qt/ChangeLog (94104 => 94105)


--- trunk/Source/WebKit/qt/ChangeLog	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-08-30 20:42:46 UTC (rev 94105)
@@ -1,3 +1,19 @@
+2011-08-30  Caio Marcelo de Oliveira Filho  <[email protected]>
+
+        Emit last progress notification before calling dispatchDidFinishLoad
+        https://bugs.webkit.org/show_bug.cgi?id=28851
+
+        Reviewed by Adam Barth.
+
+        Add infrastructure to dump progressFinishedNotification callback in DRT.
+
+        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+        (DumpRenderTreeSupportQt::dumpProgressFinishedCallback):
+        * WebCoreSupport/DumpRenderTreeSupportQt.h:
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+
 2011-08-30  Kaustubh Atrawalkar  <[email protected]>
 
         The unused ScrollView* argument can and should be removed from

Modified: trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp (94104 => 94105)


--- trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -681,6 +681,11 @@
     FrameLoaderClientQt::dumpFrameLoaderCallbacks = b;
 }
 
+void DumpRenderTreeSupportQt::dumpProgressFinishedCallback(bool b)
+{
+    FrameLoaderClientQt::dumpProgressFinishedCallback = b;
+}
+
 void DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(bool b)
 {
     FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = b;

Modified: trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h (94104 => 94105)


--- trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h	2011-08-30 20:42:46 UTC (rev 94105)
@@ -163,6 +163,7 @@
     static QString plainText(const QVariant& rng);
 
     static void dumpFrameLoader(bool b);
+    static void dumpProgressFinishedCallback(bool);
     static void dumpUserGestureInFrameLoader(bool b);
     static void dumpResourceLoadCallbacks(bool b);
     static void dumpResourceResponseMIMETypes(bool b);

Modified: trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp (94104 => 94105)


--- trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -170,6 +170,7 @@
 namespace WebCore {
 
 bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false;
+bool FrameLoaderClientQt::dumpProgressFinishedCallback = false;
 bool FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = false;
 bool FrameLoaderClientQt::dumpResourceLoadCallbacks = false;
 bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false;
@@ -592,6 +593,9 @@
 
 void FrameLoaderClientQt::postProgressFinishedNotification()
 {
+    if (dumpProgressFinishedCallback)
+        printf("postProgressFinishedNotification\n");
+
     // Send a mousemove event to:
     // (1) update the cursor to change according to whatever is underneath the mouse cursor right now;
     // (2) display the tool tip if the mouse hovers a node which has a tool tip.

Modified: trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h (94104 => 94105)


--- trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h	2011-08-30 20:42:46 UTC (rev 94105)
@@ -247,6 +247,7 @@
     const KURL& lastRequestedUrl() const { return m_lastRequestedUrl; }
 
     static bool dumpFrameLoaderCallbacks;
+    static bool dumpProgressFinishedCallback;
     static bool dumpUserGestureInFrameLoaderCallbacks;
     static bool dumpResourceLoadCallbacks;
     static bool dumpResourceResponseMIMETypes;

Modified: trunk/Tools/ChangeLog (94104 => 94105)


--- trunk/Tools/ChangeLog	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/ChangeLog	2011-08-30 20:42:46 UTC (rev 94105)
@@ -1,3 +1,45 @@
+2011-08-30  Caio Marcelo de Oliveira Filho  <[email protected]>
+
+        Emit last progress notification before calling dispatchDidFinishLoad
+        https://bugs.webkit.org/show_bug.cgi?id=28851
+
+        Reviewed by Adam Barth.
+
+        Implement dumpProgressFinishedCallback() in the layoutTestController for Qt,
+        Chromium and GTK ports. The first two were simple changes.
+
+        Some refactoring was needed in GTK port to assure that the dumps are emitted
+        correctly and the processing after the page load finished is in the right place.
+
+        To detect the load finished, we use the callback for the "load-status" notifier
+        signal of the top loading frame. And we use the deprecated "load-finished" signal
+        for dumping (if enabled) the progress finished expected output.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+        (dumpProgressFinishedCallbackCallback):
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        (LayoutTestController::dumpProgressFinishedCallback):
+        (LayoutTestController::setDumpProgressFinishedCallback):
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::dumpProgressFinishedCallback):
+        (LayoutTestController::reset):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+        (LayoutTestController::shouldDumpProgressFinishedCallback):
+        (LayoutTestController::setShouldDumpProgressFinishedCallback):
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::didStopLoading):
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (webViewLoadFinished):
+        (topLoadingFrameLoadFinished):
+        (webFrameLoadStatusNotified):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::reset):
+        (LayoutTestController::dumpProgressFinishedCallback):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
 2011-08-30  Filip Pizlo  <[email protected]>
 
         _javascript_Core does not have a good mechanism for performance

Modified: trunk/Tools/DumpRenderTree/LayoutTestController.cpp (94104 => 94105)


--- trunk/Tools/DumpRenderTree/LayoutTestController.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -56,6 +56,7 @@
     , m_dumpDatabaseCallbacks(false)
     , m_dumpEditingCallbacks(false)
     , m_dumpFrameLoadCallbacks(false)
+    , m_dumpProgressFinishedCallback(false)
     , m_dumpUserGestureInFrameLoadCallbacks(false)
     , m_dumpHistoryDelegateCallbacks(false)
     , m_dumpResourceLoadCallbacks(false)
@@ -205,6 +206,13 @@
     return JSValueMakeUndefined(context);
 }
 
+static JSValueRef dumpProgressFinishedCallbackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+    controller->setDumpProgressFinishedCallback(true);
+    return JSValueMakeUndefined(context);
+}
+
 static JSValueRef dumpUserGestureInFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -2297,6 +2305,7 @@
         { "dumpDatabaseCallbacks", dumpDatabaseCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dumpFrameLoadCallbacks", dumpFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "dumpProgressFinishedCallback", dumpProgressFinishedCallbackCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dumpUserGestureInFrameLoadCallbacks", dumpUserGestureInFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },        
         { "dumpResourceLoadCallbacks", dumpResourceLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dumpResourceResponseMIMETypes", dumpResourceResponseMIMETypesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },

Modified: trunk/Tools/DumpRenderTree/LayoutTestController.h (94104 => 94105)


--- trunk/Tools/DumpRenderTree/LayoutTestController.h	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/LayoutTestController.h	2011-08-30 20:42:46 UTC (rev 94105)
@@ -181,6 +181,9 @@
 
     bool dumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
     void setDumpFrameLoadCallbacks(bool dumpFrameLoadCallbacks) { m_dumpFrameLoadCallbacks = dumpFrameLoadCallbacks; }
+
+    bool dumpProgressFinishedCallback() const { return m_dumpProgressFinishedCallback; }
+    void setDumpProgressFinishedCallback(bool dumpProgressFinishedCallback) { m_dumpProgressFinishedCallback = dumpProgressFinishedCallback; }
     
     bool dumpUserGestureInFrameLoadCallbacks() const { return m_dumpUserGestureInFrameLoadCallbacks; }
     void setDumpUserGestureInFrameLoadCallbacks(bool dumpUserGestureInFrameLoadCallbacks) { m_dumpUserGestureInFrameLoadCallbacks = dumpUserGestureInFrameLoadCallbacks; }    
@@ -369,6 +372,7 @@
     bool m_dumpDatabaseCallbacks;
     bool m_dumpEditingCallbacks;
     bool m_dumpFrameLoadCallbacks;
+    bool m_dumpProgressFinishedCallback;
     bool m_dumpUserGestureInFrameLoadCallbacks;
     bool m_dumpHistoryDelegateCallbacks;
     bool m_dumpResourceLoadCallbacks;

Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (94104 => 94105)


--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -102,6 +102,7 @@
     bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks);
     bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
     bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
+    bindMethod("dumpProgressFinishedCallback", &LayoutTestController::dumpProgressFinishedCallback);
     bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks);
     bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
     bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes);
@@ -323,6 +324,12 @@
     result->setNull();
 }
 
+void LayoutTestController::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result)
+{
+    m_dumpProgressFinishedCallback = true;
+    result->setNull();
+}
+
 void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
 {
     m_dumpUserGestureInFrameLoadCallbacks = true;
@@ -577,6 +584,7 @@
     m_dumpAsAudio = false;
     m_dumpEditingCallbacks = false;
     m_dumpFrameLoadCallbacks = false;
+    m_dumpProgressFinishedCallback = false;
     m_dumpUserGestureInFrameLoadCallbacks = false;
     m_dumpResourceLoadCallbacks = false;
     m_dumpResourceResponseMIMETypes = false;

Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h (94104 => 94105)


--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h	2011-08-30 20:42:46 UTC (rev 94105)
@@ -94,6 +94,11 @@
     void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
 
     // This function sets a flag that tells the test_shell to print a line of
+    // descriptive text for the progress finished callback. It takes no
+    // arguments, and ignores any that may be present.
+    void dumpProgressFinishedCallback(const CppArgumentList&, CppVariant*);
+
+    // This function sets a flag that tells the test_shell to print a line of
     // user gesture status text for some frame load callbacks. It takes no
     // arguments, and ignores any that may be present.
     void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
@@ -410,6 +415,8 @@
     bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
     bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
     void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
+    bool shouldDumpProgressFinishedCallback() { return m_dumpProgressFinishedCallback; }
+    void setShouldDumpProgressFinishedCallback(bool value) { m_dumpProgressFinishedCallback = value; }
     bool shouldDumpUserGestureInFrameLoadCallbacks() { return m_dumpUserGestureInFrameLoadCallbacks; }
     void setShouldDumpUserGestureInFrameLoadCallbacks(bool value) { m_dumpUserGestureInFrameLoadCallbacks = value; }
     bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
@@ -542,6 +549,10 @@
     // load callback.
     bool m_dumpFrameLoadCallbacks;
 
+    // If true, the test_shell will output a descriptive line for the progress
+    // finished callback.
+    bool m_dumpProgressFinishedCallback;
+
     // If true, the test_shell will output a line of the user gesture status
     // text for some frame load callbacks.
     bool m_dumpUserGestureInFrameLoadCallbacks;

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (94104 => 94105)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -287,6 +287,8 @@
 
 void WebViewHost::didStopLoading()
 {
+    if (layoutTestController()->shouldDumpProgressFinishedCallback())
+        fputs("postProgressFinishedNotification\n", stdout);
     m_shell->setIsLoading(false);
 }
 

Modified: trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp (94104 => 94105)


--- trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -777,18 +777,12 @@
 
 static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
 {
+    // The deprecated "load-finished" signal is triggered by postProgressFinishedNotification(),
+    // so we can use it here in the DRT to provide the correct dump.
     if (frame != topLoadingFrame)
         return;
-
-    topLoadingFrame = 0;
-    WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test
-    if (gLayoutTestController->waitToDump())
-        return;
-
-    if (WorkQueue::shared()->count())
-        g_timeout_add(0, processWork, 0);
-    else
-        dump();
+    if (gLayoutTestController->dumpProgressFinishedCallback())
+        printf("postProgressFinishedNotification\n");
 }
 
 static gboolean webViewLoadError(WebKitWebView*, WebKitWebFrame*, gchar*, gpointer, gpointer)
@@ -1022,6 +1016,19 @@
     return WEBKIT_WEB_VIEW(webView);
 }
 
+static void topLoadingFrameLoadFinished()
+{
+    topLoadingFrame = 0;
+    WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test
+    if (gLayoutTestController->waitToDump())
+        return;
+
+    if (WorkQueue::shared()->count())
+        g_timeout_add(0, processWork, 0);
+    else
+        dump();
+}
+
 static void webFrameLoadStatusNotified(WebKitWebFrame* frame, gpointer user_data)
 {
     WebKitLoadStatus loadStatus = webkit_web_frame_get_load_status(frame);
@@ -1039,13 +1046,17 @@
                 printf("%s - didCommitLoadForFrame\n", frameName.get());
             break;
         case WEBKIT_LOAD_FINISHED:
-            if (frame != topLoadingFrame || !done)
+            if (!done)
                 printf("%s - didFinishLoadForFrame\n", frameName.get());
             break;
         default:
             break;
         }
     }
+
+    if ((loadStatus == WEBKIT_LOAD_FINISHED || loadStatus == WEBKIT_LOAD_FAILED)
+        && frame == topLoadingFrame)
+        topLoadingFrameLoadFinished();
 }
 
 static void frameCreatedCallback(WebKitWebView* webView, WebKitWebFrame* webFrame, gpointer user_data)

Modified: trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp (94104 => 94105)


--- trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp	2011-08-30 20:42:46 UTC (rev 94105)
@@ -76,6 +76,7 @@
 
     DumpRenderTreeSupportQt::dumpEditingCallbacks(false);
     DumpRenderTreeSupportQt::dumpFrameLoader(false);
+    DumpRenderTreeSupportQt::dumpProgressFinishedCallback(false);
     DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(false);
     DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false);
     DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(false);
@@ -261,6 +262,11 @@
     DumpRenderTreeSupportQt::dumpFrameLoader(true);
 }
 
+void LayoutTestController::dumpProgressFinishedCallback()
+{
+    DumpRenderTreeSupportQt::dumpProgressFinishedCallback(true);
+}
+
 void LayoutTestController::dumpUserGestureInFrameLoadCallbacks()
 {
     DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true);

Modified: trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h (94104 => 94105)


--- trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h	2011-08-30 20:39:40 UTC (rev 94104)
+++ trunk/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h	2011-08-30 20:42:46 UTC (rev 94105)
@@ -112,6 +112,7 @@
     void handleErrorPages() { m_handleErrorPages = true; }
     void dumpEditingCallbacks();
     void dumpFrameLoadCallbacks();
+    void dumpProgressFinishedCallback();
     void dumpUserGestureInFrameLoadCallbacks();
     void dumpResourceLoadCallbacks();
     void dumpResourceResponseMIMETypes();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to