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

eric at webkit.org eric at webkit.org
Thu Apr 8 00:35:39 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 76f6bad7006c8be50124fb12ec20aa463b8431ae
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 14 20:42:41 2009 +0000

    2009-12-14  Benjamin Poulain  <benjamin.poulain at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Improve the autotests of QtWebkit
            https://bugs.webkit.org/show_bug.cgi?id=32216
    
            Refactor tst_qwebelement to remove the qWait()
    
            * tests/qwebelement/tst_qwebelement.cpp:
            (tst_QWebElement::style):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52111 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 2e47981..7546635 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,15 @@
+2009-12-14  Benjamin Poulain  <benjamin.poulain at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Improve the autotests of QtWebkit
+        https://bugs.webkit.org/show_bug.cgi?id=32216
+
+        Refactor tst_qwebelement to remove the qWait()
+
+        * tests/qwebelement/tst_qwebelement.cpp:
+        (tst_QWebElement::style):
+
 2009-12-14  Andreas Kling  <andreas.kling at nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
index e9dae18..dde65cf 100644
--- a/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
+++ b/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp
@@ -18,8 +18,8 @@
 */
 
 
+#include <../util.h>
 #include <QtTest/QtTest>
-
 #include <qwebpage.h>
 #include <qwidget.h>
 #include <qwebview.h>
@@ -28,29 +28,6 @@
 //TESTED_CLASS=
 //TESTED_FILES=
 
-/**
- * Starts an event loop that runs until the given signal is received.
- Optionally the event loop
- * can return earlier on a timeout.
- *
- * \return \p true if the requested signal was received
- *         \p false on timeout
- */
-static bool waitForSignal(QObject* obj, const char* signal, int timeout = 0)
-{
-    QEventLoop loop;
-    QObject::connect(obj, signal, &loop, SLOT(quit()));
-    QTimer timer;
-    QSignalSpy timeoutSpy(&timer, SIGNAL(timeout()));
-    if (timeout > 0) {
-        QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit()));
-        timer.setSingleShot(true);
-        timer.start(timeout);
-    }
-    loop.exec();
-    return timeoutSpy.isEmpty();
-}
-
 class tst_QWebElement : public QObject
 {
     Q_OBJECT
@@ -576,9 +553,8 @@ void tst_QWebElement::style()
     "</body>";
 
     // in few seconds, the CSS should be completey loaded
-    QSignalSpy spy(m_page, SIGNAL(loadFinished(bool)));
     m_mainFrame->setHtml(html6);
-    QTest::qWait(200);
+    waitForSignal(m_page, SIGNAL(loadFinished(bool)), 200);
 
     p = m_mainFrame->documentElement().findAll("p").at(0);
     QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue"));
@@ -596,7 +572,7 @@ void tst_QWebElement::style()
 
     // in few seconds, the style should be completey loaded
     m_mainFrame->setHtml(html7);
-    QTest::qWait(200);
+    waitForSignal(m_page, SIGNAL(loadFinished(bool)), 200);
 
     p = m_mainFrame->documentElement().findAll("p").at(0);
     QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("black"));

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list