summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner/qt/TestControllerQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/WebKitTestRunner/qt/TestControllerQt.cpp')
-rw-r--r--Tools/WebKitTestRunner/qt/TestControllerQt.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp
index 9d3515c82..dd1f3cfbf 100644
--- a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp
+++ b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp
@@ -28,7 +28,6 @@
#include "TestController.h"
#include "PlatformWebView.h"
-#include "WKStringQt.h"
#include <cstdlib>
#include <QCoreApplication>
@@ -38,16 +37,17 @@
#include <QObject>
#include <QTimer>
#include <QtGlobal>
+#include <WebKit/WKStringQt.h>
#include <qquickwebview_p.h>
#include <wtf/Platform.h>
#include <wtf/text/WTFString.h>
namespace WTR {
-class TestController::RunLoop : public QObject {
+class TestController::RunLoopQt : public QObject {
Q_OBJECT
public:
- RunLoop();
+ RunLoopQt();
void runUntil(double timeout);
void notifyDone();
@@ -61,14 +61,14 @@ private:
bool m_runUntilLoopClosePending;
};
-TestController::RunLoop::RunLoop()
+TestController::RunLoopQt::RunLoopQt()
: m_runUntilLoopClosePending(false)
{
m_runUntilLoopTimer.setSingleShot(true);
QObject::connect(&m_runUntilLoopTimer, SIGNAL(timeout()), this, SLOT(timerFired()));
}
-void TestController::RunLoop::runUntil(double timeout)
+void TestController::RunLoopQt::runUntil(double timeout)
{
ASSERT(!m_runUntilLoop.isRunning());
if (timeout) {
@@ -78,7 +78,7 @@ void TestController::RunLoop::runUntil(double timeout)
m_runUntilLoop.exec(QEventLoop::ExcludeUserInputEvents);
}
-void TestController::RunLoop::notifyDone()
+void TestController::RunLoopQt::notifyDone()
{
if (m_modalLoop.isRunning()) {
// Wait for the modal loop first. We only kill it if we timeout.
@@ -90,7 +90,7 @@ void TestController::RunLoop::notifyDone()
m_runUntilLoop.exit();
}
-void TestController::RunLoop::timerFired()
+void TestController::RunLoopQt::timerFired()
{
if (m_modalLoop.isRunning()) {
m_runUntilLoopClosePending = true;
@@ -101,7 +101,7 @@ void TestController::RunLoop::timerFired()
m_runUntilLoop.exit();
}
-void TestController::RunLoop::runModal(PlatformWebView* view)
+void TestController::RunLoopQt::runModal(PlatformWebView* view)
{
ASSERT(!m_modalLoop.isRunning());
view->setModalEventLoop(&m_modalLoop);
@@ -118,10 +118,15 @@ void TestController::notifyDone()
void TestController::platformInitialize()
{
- m_runLoop = new RunLoop;
+ m_runLoop = new RunLoopQt;
QQuickWebView::platformInitialize();
}
+WKPreferencesRef TestController::platformPreferences()
+{
+ return WKPageGroupGetPreferences(m_pageGroup.get());
+}
+
void TestController::platformDestroy()
{
delete m_runLoop;
@@ -130,7 +135,7 @@ void TestController::platformDestroy()
void TestController::platformRunUntil(bool& condition, double timeout)
{
UNUSED_PARAM(condition);
- const bool shouldTimeout = !(qgetenv("QT_WEBKIT2_DEBUG") == "1" || timeout == m_noTimeout);
+ const bool shouldTimeout = !(qgetenv("QT_WEBKIT2_DEBUG") == "1" || timeout <= 0);
m_runLoop->runUntil(shouldTimeout ? timeout : 0);
}
@@ -175,7 +180,7 @@ void TestController::platformInitializeContext()
void TestController::runModal(PlatformWebView* view)
{
- shared().m_runLoop->runModal(view);
+ singleton().m_runLoop->runModal(view);
}
const char* TestController::platformLibraryPathForTesting()