[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 15:52:25 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 15b13ea68d44cd4a0b6d7184e306ceca64f3af38
Author: abecsi at webkit.org <abecsi at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 15 21:33:16 2010 +0000
2010-11-15 Andras Becsi <abecsi at webkit.org>
Reviewed by Andreas Kling.
[Qt][WK2] Avoid polling in WebKitTestRunner.
https://bugs.webkit.org/show_bug.cgi?id=49542
Make the WK2 testing session about 10-15% faster and decrease random flakiness
resulting from timing skew by removing the millisecond polling from TestControllerQt.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didFinishLoadForFrame):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::notifyDone): Add method stub.
* WebKitTestRunner/qt/TestControllerQt.cpp:
(WTR::TestControllerRunLoop::instance):
(WTR::TestControllerRunLoop::start):
(WTR::TestControllerRunLoop::stop):
(WTR::TestControllerRunLoop::TestControllerRunLoop):
(WTR::TestControllerRunLoop::timerEvent):
(WTR::TestController::notifyDone):
(WTR::TestController::platformRunUntil):
* WebKitTestRunner/win/TestControllerWin.cpp:
(WTR::TestController::notifyDone): Add method stub.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 22dc1fb..d316717 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,31 @@
+2010-11-15 Andras Becsi <abecsi at webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt][WK2] Avoid polling in WebKitTestRunner.
+ https://bugs.webkit.org/show_bug.cgi?id=49542
+
+ Make the WK2 testing session about 10-15% faster and decrease random flakiness
+ resulting from timing skew by removing the millisecond polling from TestControllerQt.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::didFinishLoadForFrame):
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::notifyDone): Add method stub.
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::TestControllerRunLoop::instance):
+ (WTR::TestControllerRunLoop::start):
+ (WTR::TestControllerRunLoop::stop):
+ (WTR::TestControllerRunLoop::TestControllerRunLoop):
+ (WTR::TestControllerRunLoop::timerEvent):
+ (WTR::TestController::notifyDone):
+ (WTR::TestController::platformRunUntil):
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::notifyDone): Add method stub.
+
2010-11-15 Darin Adler <darin at apple.com>
* Scripts/webkitpy/common/net/bugzilla: Added property svn:ignore.
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
index 8ca0529..3fc92f2 100644
--- a/WebKitTools/WebKitTestRunner/TestController.cpp
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -388,6 +388,7 @@ void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame)
return;
m_doneResetting = true;
+ shared().notifyDone();
}
} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
index 1396c94..4c05bf4 100644
--- a/WebKitTools/WebKitTestRunner/TestController.h
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -56,6 +56,7 @@ public:
// Runs the run loop until `done` is true or the timeout elapses.
enum TimeoutDuration { ShortTimeout, LongTimeout };
void runUntil(bool& done, TimeoutDuration);
+ void notifyDone();
private:
void initialize(int argc, const char* argv[]);
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
index e88de53..26ecfc0 100644
--- a/WebKitTools/WebKitTestRunner/TestInvocation.cpp
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -163,6 +163,7 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
m_gotInitialResponse = true;
m_gotFinalMessage = true;
m_error = true;
+ TestController::shared().notifyDone();
return;
}
@@ -171,6 +172,7 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
WKStringRef messageBodyString = static_cast<WKStringRef>(messageBody);
if (WKStringIsEqualToUTF8CString(messageBodyString, "BeginTest")) {
m_gotInitialResponse = true;
+ TestController::shared().notifyDone();
return;
}
@@ -184,6 +186,7 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
dump(toSTD(messageBodyString).c_str());
m_gotFinalMessage = true;
+ TestController::shared().notifyDone();
return;
}
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
index 268f718..fee0070 100644
--- a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -30,6 +30,10 @@
namespace WTR {
+void TestController::notifyDone()
+{
+}
+
void TestController::platformInitialize()
{
}
diff --git a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
index d3fc5bf..ca0a00c 100644
--- a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
+++ b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
@@ -30,11 +30,6 @@
#include <cstdlib>
#include <QCoreApplication>
-#if (QT_VERSION >= 0x040700)
-# include <QElapsedTimer>
-#else
-# include <QTime>
-#endif
#include <QEventLoop>
#include <QFileInfo>
#include <QLibrary>
@@ -45,60 +40,52 @@
namespace WTR {
-// With a bigger interval we would waste to much time
-// after the test had been finished.
-static const unsigned kTimerIntervalMS = 1;
-
-class RunUntilConditionLoop : public QObject {
+class TestControllerRunLoop : public QObject {
Q_OBJECT
-
public:
- static void start(bool& done, int timeout)
+ static TestControllerRunLoop* instance()
{
- static RunUntilConditionLoop* instance = new RunUntilConditionLoop;
- instance->run(done, timeout);
+ static TestControllerRunLoop* result = new TestControllerRunLoop;
+ return result;
}
-private:
- RunUntilConditionLoop() {}
-
- void run(bool& done, int timeout)
+ void start(int msec)
{
- m_condition = &done;
- m_timeout = timeout;
- m_elapsedTime.start();
- m_timerID = startTimer(kTimerIntervalMS);
+ m_timerID = startTimer(msec);
ASSERT(m_timerID);
m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
}
- virtual void timerEvent(QTimerEvent*)
+ void stop()
{
- if (!*m_condition && m_elapsedTime.elapsed() < m_timeout)
- return;
-
killTimer(m_timerID);
- m_eventLoop.exit();
+ m_eventLoop.quit();
+ }
+private:
+ TestControllerRunLoop() {}
+
+ void timerEvent(QTimerEvent*)
+ {
+ fprintf(stderr, "FAIL: TestControllerRunLoop timed out.\n");
+ stop();
}
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::notifyDone()
+{
+ TestControllerRunLoop::instance()->stop();
+}
+
void TestController::platformInitialize()
{
}
-void TestController::platformRunUntil(bool& done, double timeout)
+void TestController::platformRunUntil(bool&, double timeout)
{
- RunUntilConditionLoop::start(done, static_cast<int>(timeout * 1000));
+ TestControllerRunLoop::instance()->start(static_cast<int>(timeout * 1000));
}
static bool isExistingLibrary(const QString& path)
diff --git a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
index 3fd853f..89e29fd 100644
--- a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
+++ b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
@@ -90,6 +90,10 @@ static LONG WINAPI exceptionFilter(EXCEPTION_POINTERS*)
return EXCEPTION_CONTINUE_SEARCH;
}
+void TestController::notifyDone()
+{
+}
+
void TestController::platformInitialize()
{
::SetUnhandledExceptionFilter(exceptionFilter);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list