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

abecsi at webkit.org abecsi at webkit.org
Wed Dec 22 14:21:05 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3f33d16cdf2402ddeedf216907d17d41a18cd44b
Author: abecsi at webkit.org <abecsi at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 6 23:28:34 2010 +0000

    2010-10-06  Balazs Kelemen  <kbalazs at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Runloop implementation for WTR
            https://bugs.webkit.org/show_bug.cgi?id=47280
    
            * WebKitTestRunner/qt/TestControllerQt.cpp:
            Implemented TestController::runUntil by a timerEvent
            and a QEventLoop. We step into the event loop from runUntil.
            While we are waiting in the loop a timerEvent is periodically
            checking the value of the condition. Once the condition has
            becoming true the timerEvent wakes us up.
            (WTR::RunUntilLoop::start):
            (WTR::RunUntilLoop::RunUntilLoop):
            (WTR::RunUntilLoop::run):
            (WTR::RunUntilLoop::timerEvent):
            (WTR::TestController::platformInitialize):
            (WTR::TestController::runUntil):
            * WebKitTestRunner/qt/main.cpp:
            Start the main event loop first and creating the TestController later.
            (Launcher::Launcher):
            (Launcher::~Launcher):
            (Launcher::launch): Creating the TestController.
            (main): Setting up a timer for calling Launcher::launch from
            the main event loop.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 4355aee..aee6388 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,30 @@
+2010-10-06  Balazs Kelemen  <kbalazs at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Runloop implementation for WTR
+        https://bugs.webkit.org/show_bug.cgi?id=47280
+
+        * WebKitTestRunner/qt/TestControllerQt.cpp:
+        Implemented TestController::runUntil by a timerEvent
+        and a QEventLoop. We step into the event loop from runUntil.
+        While we are waiting in the loop a timerEvent is periodically
+        checking the value of the condition. Once the condition has
+        becoming true the timerEvent wakes us up.
+        (WTR::RunUntilLoop::start):
+        (WTR::RunUntilLoop::RunUntilLoop):
+        (WTR::RunUntilLoop::run):
+        (WTR::RunUntilLoop::timerEvent):
+        (WTR::TestController::platformInitialize):
+        (WTR::TestController::runUntil):
+        * WebKitTestRunner/qt/main.cpp:
+        Start the main event loop first and creating the TestController later.
+        (Launcher::Launcher):
+        (Launcher::~Launcher):
+        (Launcher::launch): Creating the TestController.
+        (main): Setting up a timer for calling Launcher::launch from
+        the main event loop.
+
 2010-10-06  Dirk Pranke  <dpranke at chromium.org>
 
         Reviewed by Kenneth Russell.
diff --git a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
index b697471..05218d0 100644
--- a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
+++ b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
@@ -25,18 +25,59 @@
  */
 
 #include "TestController.h"
+
 #include "NotImplemented.h"
+#include <QCoreApplication>
+#include <QEventLoop>
+#include <QObject>
 
 namespace WTR {
 
-void TestController::runUntil(bool& done)
+static const unsigned kTimerIntervalMS = 50;
+
+class RunUntilLoop : public QObject {
+    Q_OBJECT
+
+public:
+    static void start(bool& done)
+    {
+        static RunUntilLoop* instance = new RunUntilLoop;
+        instance->run(done);
+    }
+
+private:
+    RunUntilLoop() {}
+
+    void run(bool& done)
+    {
+        m_condition = &done;
+        m_timerID = startTimer(kTimerIntervalMS);
+        ASSERT(m_timerID);
+        m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
+    }
+
+    virtual void timerEvent(QTimerEvent*)
+    {
+        if (!*m_condition)
+            return;
+
+        killTimer(m_timerID);
+        m_eventLoop.exit();
+    }
+
+    QEventLoop m_eventLoop;
+    bool* m_condition;
+    int m_timerID;
+};
+
+void TestController::platformInitialize()
 {
-    notImplemented();
 }
 
-void TestController::platformInitialize()
+void TestController::runUntil(bool& done)
 {
-    notImplemented();
+    RunUntilLoop::start(done);
+    ASSERT(done);
 }
 
 void TestController::initializeInjectedBundlePath()
@@ -54,4 +95,6 @@ void TestController::platformInitializeContext()
     notImplemented();
 }
 
+#include "TestControllerQt.moc"
+
 } // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/qt/main.cpp b/WebKitTools/WebKitTestRunner/qt/main.cpp
index 2523f51..4312a05 100644
--- a/WebKitTools/WebKitTestRunner/qt/main.cpp
+++ b/WebKitTools/WebKitTestRunner/qt/main.cpp
@@ -26,9 +26,44 @@
 
 #include "TestController.h"
 
-int main(int argc, const char* argv[])
-{
-    WTR::TestController controller(argc, argv);
+#include <QApplication>
+#include <QObject>
+#include <QTimer>
+
+class Launcher : public QObject {
+    Q_OBJECT
+
+public:
+    Launcher(int argc, char** argv)
+        : m_argc(argc)
+        , m_argv(argv)
+    {
+    }
+
+    ~Launcher()
+    {
+        delete m_controller;
+    }
 
-    return 0;
+public slots:
+    void launch()
+    {
+        m_controller = new WTR::TestController(m_argc, const_cast<const char**>(m_argv));
+        QApplication::exit();
+    }
+
+private:
+    WTR::TestController* m_controller;
+    int m_argc;
+    char** m_argv;
+};
+
+int main(int argc, char** argv)
+{
+    QApplication app(argc, argv);
+    Launcher launcher(argc, argv);
+    QTimer::singleShot(0, &launcher, SLOT(launch()));
+    return app.exec();;
 }
+
+#include "main.moc"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list