Holger Hans Peter Freyther <holger.freyther@trolltech.com>
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Apr 2008 10:31:18 +0000 (10:31 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Apr 2008 10:31:18 +0000 (10:31 +0000)
* For the http tests we need the output of the FrameLoaderClient. The QtWebKit API
  is not exporting enough to create the output in DRT itself. Settle with the approach
  Lars has taken for the Editing support and add branches to our FrameLoaderClient code.
* run-webkit-tests http/tests(/loading) can now be executed.
* For tests in loading/ directories we are going to throw away the dirty
  QWebPage to start with something clean.

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

WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp

index ffa6616..955f680 100644 (file)
@@ -1,3 +1,32 @@
+2008-04-03  Holger Hans Peter Freyther  <holger.freyther@trolltech.com>
+
+        Reviewed by Simon.
+
+        * For the http tests we need the output of the FrameLoaderClient. The QtWebKit API
+        is not exporting enough to create the output in DRT itself. Settle with the approach
+        Lars has taken for the Editing support and add branches to our FrameLoaderClient code.
+        * run-webkit-tests http/tests(/loading) can now be executed.
+        * For tests in loading/ directories we are going to throw away the dirty
+        QWebPage to start with something clean.
+        
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (qt_dump_frame_loader):
+        (drtDescriptionSuitableForTestResult):
+        (WebCore::FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidCancelClientRedirect):
+        (WebCore::FrameLoaderClientQt::dispatchWillPerformClientRedirect):
+        (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage):
+        (WebCore::FrameLoaderClientQt::dispatchWillClose):
+        (WebCore::FrameLoaderClientQt::dispatchDidStartProvisionalLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+        (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFinishDocumentLoad):
+        (WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
+        (WebCore::FrameLoaderClientQt::registerForIconNotification):
+        (WebCore::FrameLoaderClientQt::setMainDocumentError):
+        (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
 2008-04-02  Holger Hans Peter Freyther  <holger.freyther@trolltech.com>
 
         Reviewed by Simon.
index 1f8bbdf..0f78425 100644 (file)
 #include "qwebnetworkinterface_p.h"
 #endif
 
+static bool dumpFrameLoaderCallbacks = false;
+
+void QWEBKIT_EXPORT qt_dump_frame_loader(bool b)
+{
+    dumpFrameLoaderCallbacks = b;
+}
+
+// Compare with WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
+static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame)
+{
+    QWebFrame* frame = QWebFramePrivate::kit(_frame);
+    QString name = frame->name();
+
+    bool isMainFrame = frame == frame->page()->mainFrame();  
+    if (isMainFrame) {
+        if (!name.isEmpty())
+            return QString::fromLatin1("main frame \"%1\"").arg(name);
+        return QLatin1String("main frame");
+    } else {
+        if (!name.isEmpty())
+            return QString::fromLatin1("frame \"%1\"").arg(name);
+        return QLatin1String("frame (anonymous)");
+    }
+}
+
+static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url)
+{
+    QUrl url = _url;
+    return url.toString();
+}
+
+
 namespace WebCore
 {
 
@@ -224,42 +256,62 @@ void FrameLoaderClientQt::detachedFromParent4()
 void FrameLoaderClientQt::dispatchDidHandleOnloadEvents()
 {
     // don't need this one
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didHandleOnloadEventsForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
 }
 
 
 void FrameLoaderClientQt::dispatchDidReceiveServerRedirectForProvisionalLoad()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     notImplemented();
 }
 
 
 void FrameLoaderClientQt::dispatchDidCancelClientRedirect()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didCancelClientRedirectForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     notImplemented();
 }
 
 
-void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL&,
+void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url,
                                                             double interval,
                                                             double fireDate)
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - willPerformClientRedirectToURL: %s \n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(drtDescriptionSuitableForTestResult(url)));
+
     notImplemented();
 }
 
 
 void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didChangeLocationWithinPageForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     notImplemented();
 }
 
 
 void FrameLoaderClientQt::dispatchWillClose()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - willCloseFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
 }
 
 
 void FrameLoaderClientQt::dispatchDidStartProvisionalLoad()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didStartProvisionalLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_webFrame)
         emit m_webFrame->provisionalLoad();
 }
@@ -267,9 +319,14 @@ void FrameLoaderClientQt::dispatchDidStartProvisionalLoad()
 
 void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title)
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didReceiveTitle: %s\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(QString(title)));
+
     if (!m_webFrame)
         return;
 
+
+
     // ### hack
     emit m_webFrame->urlChanged(m_webFrame->url());
     emit titleChanged(title);
@@ -278,22 +335,33 @@ void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title)
 
 void FrameLoaderClientQt::dispatchDidCommitLoad()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didCommitLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_frame->tree()->parent() || !m_webFrame)
         return;
+
     m_webFrame->page()->d->updateNavigationActions();
 }
 
 
 void FrameLoaderClientQt::dispatchDidFinishDocumentLoad()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didFinishDocumentLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_frame->tree()->parent() || !m_webFrame)
         return;
+        
     m_webFrame->page()->d->updateNavigationActions();
 }
 
 
 void FrameLoaderClientQt::dispatchDidFinishLoad()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didFinishLoadForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_webFrame)
         emit m_webFrame->loadDone(true);
     if (m_frame->tree()->parent() || !m_webFrame)
@@ -464,6 +532,9 @@ String FrameLoaderClientQt::userAgent(const KURL& url)
 
 void FrameLoaderClientQt::dispatchDidReceiveIcon()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didReceiveIconForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_webFrame) {
         emit m_webFrame->iconLoaded();
     }
@@ -485,6 +556,9 @@ bool FrameLoaderClientQt::canHandleRequest(const WebCore::ResourceRequest&) cons
 
 void FrameLoaderClientQt::windowObjectCleared()
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didClearWindowObjectForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_webFrame)
         emit m_webFrame->cleared();
 }
@@ -673,12 +747,18 @@ bool FrameLoaderClientQt::dispatchDidLoadResourceFromMemoryCache(WebCore::Docume
 
 void FrameLoaderClientQt::dispatchDidFailProvisionalLoad(const WebCore::ResourceError&)
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didFailProvisionalLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_webFrame)
         emit m_webFrame->loadDone(false);
 }
 
 void FrameLoaderClientQt::dispatchDidFailLoad(const WebCore::ResourceError&)
 {
+    if (dumpFrameLoaderCallbacks)
+        printf("%s - didFailLoadWithError\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)));
+
     if (m_webFrame)
         emit m_webFrame->loadDone(false);
 }
index 654dbc6..bd217ef 100644 (file)
@@ -2,6 +2,20 @@
 
         Reviewed by Simon.
 
+        * For the http tests we need the output of the FrameLoaderClient. The QtWebKit API
+        is not exporting enough to create the output in DRT itself. Settle with the approach
+        Lars has taken for the Editing support and add branches to our FrameLoaderClient code.
+        * run-webkit-tests http/tests(/loading) can now be executed.
+        * For tests in loading/ directories we are going to throw away the dirty
+        QWebPage to start with something clean.
+        
+
+        * DumpRenderTree/qt/DumpRenderTree.cpp:
+
+2008-04-03  Holger Hans Peter Freyther  <holger.freyther@trolltech.com>
+
+        Reviewed by Simon.
+
         * Treat http and https as special URLs as well. Change the main.cpp and
         DumpRenderTree.cpp to handle http and https URIs as input.
         * I'm not doing the clean up and merging of these two checks now.
index 22edc84..bdec2ad 100644 (file)
 
 #include <unistd.h>
 #include <qdebug.h>
+
 extern void qt_drt_run(bool b);
 extern void qt_dump_set_accepts_editing(bool b);
+extern void qt_dump_frame_loader(bool b);
 
 
 namespace WebCore {
@@ -173,6 +175,8 @@ void DumpRenderTree::open()
 void DumpRenderTree::open(const QUrl& url)
 {
     resetJSObjects();
+
+    qt_dump_frame_loader(url.toString().contains("loading/"));
     m_page->mainFrame()->load(url);
 }