[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

benjamin.poulain at nokia.com benjamin.poulain at nokia.com
Wed Dec 22 15:47:22 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 171813c7dd289793a9249f18650770e0b9a0bf4f
Author: benjamin.poulain at nokia.com <benjamin.poulain at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 12 11:30:46 2010 +0000

    2010-11-12  Benjamin Poulain  <benjamin.poulain at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] TestController::runUntil doesn't honor the timeout parameter
            https://bugs.webkit.org/show_bug.cgi?id=48941
    
            Implement the missing timeout of WebKitTestRunner for Qt.
    
            A QElapsedTimer has been added to RunUntilConditionLoop in order
            to measure how long the loop has been running. When the timer
            is bigger or equal than the timeout, the loop ends even if the
            condition is not met.
    
            * WebKitTestRunner/qt/TestControllerQt.cpp:
            (WTR::RunUntilConditionLoop::start):
            (WTR::RunUntilConditionLoop::run):
            (WTR::RunUntilConditionLoop::timerEvent):
            (WTR::TestController::platformRunUntil):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71902 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 37de9de..0384a68 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,23 @@
+2010-11-12  Benjamin Poulain  <benjamin.poulain at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] TestController::runUntil doesn't honor the timeout parameter
+        https://bugs.webkit.org/show_bug.cgi?id=48941
+
+        Implement the missing timeout of WebKitTestRunner for Qt.
+
+        A QElapsedTimer has been added to RunUntilConditionLoop in order
+        to measure how long the loop has been running. When the timer
+        is bigger or equal than the timeout, the loop ends even if the
+        condition is not met.
+
+        * WebKitTestRunner/qt/TestControllerQt.cpp:
+        (WTR::RunUntilConditionLoop::start):
+        (WTR::RunUntilConditionLoop::run):
+        (WTR::RunUntilConditionLoop::timerEvent):
+        (WTR::TestController::platformRunUntil):
+
 2010-11-11  David Levin  <levin at chromium.org>
 
         Reviewed by Shinichiro Hamaji.
diff --git a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
index d4de1ba..d3fc5bf 100644
--- a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
+++ b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
@@ -30,6 +30,11 @@
 
 #include <cstdlib>
 #include <QCoreApplication>
+#if (QT_VERSION >= 0x040700)
+#    include <QElapsedTimer>
+#else
+#    include <QTime>
+#endif
 #include <QEventLoop>
 #include <QFileInfo>
 #include <QLibrary>
@@ -48,18 +53,20 @@ class RunUntilConditionLoop : public QObject {
     Q_OBJECT
 
 public:
-    static void start(bool& done)
+    static void start(bool& done, int timeout)
     {
         static RunUntilConditionLoop* instance = new RunUntilConditionLoop;
-        instance->run(done);
+        instance->run(done, timeout);
     }
 
 private:
     RunUntilConditionLoop() {}
 
-    void run(bool& done)
+    void run(bool& done, int timeout)
     {
         m_condition = &done;
+        m_timeout = timeout;
+        m_elapsedTime.start();
         m_timerID = startTimer(kTimerIntervalMS);
         ASSERT(m_timerID);
         m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
@@ -67,7 +74,7 @@ private:
 
     virtual void timerEvent(QTimerEvent*)
     {
-        if (!*m_condition)
+        if (!*m_condition && m_elapsedTime.elapsed() < m_timeout)
             return;
 
         killTimer(m_timerID);
@@ -77,17 +84,21 @@ private:
     QEventLoop m_eventLoop;
     bool* m_condition;
     int m_timerID;
+    int m_timeout;
+#if (QT_VERSION >= 0x040700)
+    QElapsedTimer m_elapsedTime;
+#else
+    QTime m_elapsedTime;
+#endif
 };
 
 void TestController::platformInitialize()
 {
 }
 
-void TestController::platformRunUntil(bool& done, double)
+void TestController::platformRunUntil(bool& done, double timeout)
 {
-    // FIXME: Honor the timeout parameter <http://webkit.org/b/48941>.
-    RunUntilConditionLoop::start(done);
-    ASSERT(done);
+    RunUntilConditionLoop::start(done, static_cast<int>(timeout * 1000));
 }
 
 static bool isExistingLibrary(const QString& path)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list