[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

kenneth at webkit.org kenneth at webkit.org
Wed Apr 7 23:14:52 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 3225a82c4f4f26fbd3e62d73cbc3f51fa3be00a2
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 29 19:06:55 2009 +0000

    Implement DRT functionality for Qt introduced in
    r28690 and r28705.
    
    Patch by Kenneth Rohde Christiansen <kenneth at webkit.org> on 2009-10-29
    Reviewed by Adam Roben.
    
    - Implemented pathToLocalResource which exposes the functionality of
    converting a given unix path to the correct location on Windows.
    - Implemented a way to remove machine-dependent information from paths
    in layout test results.
    
    * DumpRenderTree/qt/DumpRenderTree.cpp:
    (WebCore::urlSuitableForTestResult):
    (WebCore::WebPage::javaScriptConsoleMessage):
    * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
    (LayoutTestController::pathToLocalResource):
    * DumpRenderTree/qt/LayoutTestControllerQt.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50289 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 7dcbf6c..f25e670 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,22 @@
+2009-10-29  Kenneth Rohde Christiansen  <kenneth at webkit.org>
+
+        Reviewed by Adam Roben.
+
+        Implement DRT functionality for Qt introduced in
+        r28690 and r28705.
+
+        - Implemented pathToLocalResource which exposes the functionality of
+        converting a given unix path to the correct location on Windows.
+        - Implemented a way to remove machine-dependent information from paths
+        in layout test results.
+
+        * DumpRenderTree/qt/DumpRenderTree.cpp:
+        (WebCore::urlSuitableForTestResult):
+        (WebCore::WebPage::javaScriptConsoleMessage):
+        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+        (LayoutTestController::pathToLocalResource):
+        * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
 2009-10-28  Roland Steiner  <rolandsteiner at chromium.org>
 
         Adding myself to the committers list.
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
index 9faa37f..e255052 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp
@@ -46,6 +46,7 @@
 #include <QScrollArea>
 #include <QApplication>
 #include <QUrl>
+#include <QFileInfo>
 #include <QFocusEvent>
 #include <QFontDatabase>
 #include <QNetworkRequest>
@@ -156,9 +157,27 @@ void WebPage::javaScriptAlert(QWebFrame*, const QString& message)
     fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData());
 }
 
+static QString urlSuitableForTestResult(const QString& url)
+{
+    if (url.isEmpty() || !url.startsWith(QLatin1String("file://")))
+        return url;
+
+    return QFileInfo(url).fileName();
+}
+
 void WebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString&)
 {
-    fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.toUtf8().constData());
+    QString newMessage;
+    if (!message.isEmpty()) {
+        newMessage = message;
+
+        size_t fileProtocol = newMessage.indexOf(QLatin1String("file://"));
+        if (fileProtocol != -1) {
+            newMessage = newMessage.left(fileProtocol) + urlSuitableForTestResult(newMessage.mid(fileProtocol));
+        }
+    }
+
+    fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, newMessage.toUtf8().constData());
 }
 
 bool WebPage::javaScriptConfirm(QWebFrame*, const QString& msg)
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index b8de6a5..575bc66 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -32,6 +32,7 @@
 #include "DumpRenderTree.h"
 #include "WorkQueue.h"
 #include "WorkQueueItem.h"
+#include <QDir>
 
 extern void qt_dump_editing_callbacks(bool b);
 extern void qt_dump_resource_load_callbacks(bool b);
@@ -142,6 +143,12 @@ void LayoutTestController::clearBackForwardList()
     m_drt->webPage()->history()->clear();
 }
 
+QString LayoutTestController::pathToLocalResource(const QString& url)
+{
+    // Function introduced in r28690.
+    return QLatin1String("file://") + QUrl(url).toLocalFile();
+}
+
 void LayoutTestController::dumpEditingCallbacks()
 {
     qDebug() << ">>>dumpEditingCallbacks";
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index cab014c..c852089 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -99,6 +99,7 @@ public slots:
     int windowCount();
     void display() {}
     void clearBackForwardList();
+    QString pathToLocalResource(const QString& url);
     void dumpTitleChanges() { m_dumpTitleChanges = true; }
     QString encodeHostName(const QString& host);
     QString decodeHostName(const QString& host);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list