From: hausmann@webkit.org Date: Thu, 3 Apr 2008 10:31:18 +0000 (+0000) Subject: Holger Hans Peter Freyther X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=commitdiff_plain;h=4754bc6bf3945fd742bc1927341a170e7c9810a9 Holger Hans Peter Freyther * 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 --- diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index ffa6616..955f680 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,32 @@ +2008-04-03 Holger Hans Peter Freyther + + 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 Reviewed by Simon. diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 1f8bbdf..0f78425 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -65,6 +65,38 @@ #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); } diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 654dbc6..bd217ef 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -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 + + 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. diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp index 22edc84..bdec2ad 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp @@ -48,8 +48,10 @@ #include #include + 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); }