2006-10-12 Nikolas Zimmermann <zimmermann@kde.org>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 01:33:04 +0000 (01:33 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Oct 2006 01:33:04 +0000 (01:33 +0000)
        Reviewed by Maciej.

        Exclude some tests which crash or hang from Qt/Linux DRT.
        These are known to fail, and will be fixed at some point :-)

        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
        (WebCore::DumpRenderTree::DumpRenderTree):
        (WebCore::DumpRenderTree::open):
        (WebCore::DumpRenderTree::readStdin):
        (WebCore::DumpRenderTree::readSkipFile):
        (WebCore::DumpRenderTree::checkLoaded):
        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h:
        * DumpRenderTree/DumpRenderTree.qtproj/tests-skipped.txt: Added.

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

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h

index 5aa290cb78b6d493ab5ef3e68ea92e55fb624de2..04a98cf3cdf9dd25a556bad1a7569ac788724e89 100644 (file)
@@ -1,3 +1,19 @@
+2006-10-12  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Maciej.
+
+        Exclude some tests which crash or hang from Qt/Linux DRT.
+        These are known to fail, and will be fixed at some point :-)
+
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.cpp:
+        (WebCore::DumpRenderTree::DumpRenderTree):
+        (WebCore::DumpRenderTree::open):
+        (WebCore::DumpRenderTree::readStdin):
+        (WebCore::DumpRenderTree::readSkipFile):
+        (WebCore::DumpRenderTree::checkLoaded):
+        * DumpRenderTree/DumpRenderTree.qtproj/DumpRenderTree.h:
+        * DumpRenderTree/DumpRenderTree.qtproj/tests-skipped.txt: Added.
+
 2006-10-12  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by Maciej.
index 54d513ff583d389890aa6bf8a9c161dfc2df1edc..886266de04901305bcba41498a02490ee198d0fd 100644 (file)
 #include "Document.h"
 #include "RenderTreeAsText.h"
 
+#include <QDir>
+#include <QFile>
 #include <QTimer>
 #include <QBoxLayout>
-#include <QApplication>
-#include <QDebug>
 #include <QScrollArea>
+#include <QApplication>
 
 #include <unistd.h>
 
@@ -74,6 +75,9 @@ DumpRenderTree::DumpRenderTree()
     unsigned int viewHeight = maxViewHeight + 2 * area->frameWidth();
 
     area->resize(viewWidth, viewHeight);
+
+    // Read file containing to be skipped tests...
+    readSkipFile();
 }
 
 DumpRenderTree::~DumpRenderTree()
@@ -98,6 +102,15 @@ void DumpRenderTree::open()
 
 void DumpRenderTree::open(const KURL& url)
 {
+    Q_ASSERT(url.isLocalFile());
+
+    // Ignore skipped tests
+    if (m_skipped.indexOf(url.path()) != -1) { 
+        fprintf(stdout, "#EOF\n");
+        fflush(stdout);
+        return;
+    }
+
     m_frame->openURL(url);
 
     // Simple poll mechanism, to find out when the page is loaded...
@@ -108,13 +121,43 @@ void DumpRenderTree::readStdin(int /* socket */)
 {
     // Read incoming data from stdin...
     QString line = m_stdin->readLine(); 
-    if (!line.isEmpty())
+    if (!line.isEmpty()) 
         open(KURL(line.toLatin1()));
 }
 
+void DumpRenderTree::readSkipFile()
+{
+    Q_ASSERT(m_skipped.isEmpty());
+
+    QFile file("WebKitTools/DumpRenderTree/DumpRenderTree.qtproj/tests-skipped.txt");
+    if (!file.exists()) {
+        qFatal("Run DumpRenderTree from the source root directory!\n");
+        return;
+    }
+
+    if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+        qFatal("Couldn't read skip file!\n");
+        return;
+    }
+
+    QString testsPath = QDir::currentPath() + "/LayoutTests/";
+    while (!file.atEnd()) {
+        QByteArray line = file.readLine();
+
+        // Remove trailing line feed
+        line.chop(1);
+
+        // Ignore comments
+        if (line.isEmpty() || line.startsWith('#'))
+            continue;
+
+        m_skipped.append(testsPath + line);
+    }
+}
+
 void DumpRenderTree::checkLoaded()
 {
-    if(m_frame->isComplete()) {
+    if (m_frame->isComplete()) {
         if (!m_notifier) {
             // Dump markup in single file mode...
             DeprecatedString markup = createMarkup(m_frame->document());
index 0a8b0ab931f1c8b2d1b05f3893f9fce88ae87451..3e9c51b37ed05ccf5d42aeb9a880e5eb15c78039 100644 (file)
@@ -29,6 +29,7 @@
 #ifndef DUMPRENDERTREE_H
 #define DUMPRENDERTREE_H
 
+#include <QList>
 #include <QObject>
 #include <QTextStream>
 #include <QSocketNotifier>
@@ -49,7 +50,7 @@ public:
 
     // Initialize in single-file mode.
     void open(const KURL& url);
-    
+   
 public Q_SLOTS:
     void readStdin(int);
     void checkLoaded();
@@ -60,11 +61,16 @@ private:
     FrameQt* frame() const;
 
 private:
+    void readSkipFile();
     FrameQt* m_frame;
     DumpRenderTreeClient* m_client;
 
     QTextStream* m_stdin;
     QSocketNotifier* m_notifier;
+
+    // To be skipped tests
+    QList<QString> m_skipped;
 };
 
 }