diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/qt')
-rw-r--r-- | WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp | 14 | ||||
-rw-r--r-- | WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp | 25 | ||||
-rw-r--r-- | WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h | 4 |
3 files changed, 42 insertions, 1 deletions
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 00ccdb5..4e6f049 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -567,6 +567,13 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting() setlocale(LC_ALL, ""); } +static bool isGlobalHistoryTest(const QUrl& url) +{ + if (url.path().contains("globalhistory/")) + return true; + return false; +} + static bool isWebInspectorTest(const QUrl& url) { if (url.path().contains("inspector/")) @@ -595,6 +602,9 @@ void DumpRenderTree::open(const QUrl& url) layoutTestController()->showWebInspector(); } + if (isGlobalHistoryTest(url)) + layoutTestController()->dumpHistoryCallbacks(); + // W3C SVG tests expect to be 480x360 bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1"); int width = isW3CTest ? 480 : LayoutTestController::maxViewWidth; @@ -668,8 +678,10 @@ void DumpRenderTree::processArgsLine(const QStringList &args) void DumpRenderTree::loadNextTestInStandAloneMode() { - if (m_standAloneModeTestList.isEmpty()) + if (m_standAloneModeTestList.isEmpty()) { emit quit(); + return; + } processLine(m_standAloneModeTestList.first()); m_standAloneModeTestList.removeFirst(); diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index b783141..b2ef716 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -81,6 +81,8 @@ void LayoutTestController::reset() DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(QStringList()); DumpRenderTreeSupportQt::clearScriptWorlds(); DumpRenderTreeSupportQt::setCustomPolicyDelegate(false, false); + DumpRenderTreeSupportQt::dumpHistoryCallbacks(false); + DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false); setIconDatabaseEnabled(false); emit hidePage(); @@ -206,6 +208,11 @@ bool LayoutTestController::checkDesktopNotificationPermission(const QString& ori return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin); } +void LayoutTestController::simulateDesktopNotificationClick(const QString& title) +{ + DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title); +} + void LayoutTestController::display() { emit showPage(); @@ -222,6 +229,12 @@ QString LayoutTestController::pathToLocalResource(const QString& url) return QDir::toNativeSeparators(url); } +void LayoutTestController::dumpConfigurationForViewport(int availableWidth, int availableHeight) +{ + QString res = DumpRenderTreeSupportQt::viewportAsText(m_drt->webPage(), QSize(availableWidth, availableHeight)); + fputs(qPrintable(res), stdout); +} + void LayoutTestController::dumpEditingCallbacks() { qDebug() << ">>>dumpEditingCallbacks"; @@ -243,6 +256,11 @@ void LayoutTestController::dumpResourceResponseMIMETypes() DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(true); } +void LayoutTestController::dumpHistoryCallbacks() +{ + DumpRenderTreeSupportQt::dumpHistoryCallbacks(true); +} + void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(bool enabled) { DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(enabled); @@ -769,5 +787,12 @@ void LayoutTestController::addUserStyleSheet(const QString& sourceCode) DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->webPage(), sourceCode); } +void LayoutTestController::removeAllVisitedLinks() +{ + QWebHistory* history = m_drt->webPage()->history(); + history->clear(); + DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(true); +} + const unsigned LayoutTestController::maxViewWidth = 800; const unsigned LayoutTestController::maxViewHeight = 600; diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h index 7e58f44..ec89acb 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h @@ -108,6 +108,8 @@ public slots: void dumpFrameLoadCallbacks(); void dumpResourceLoadCallbacks(); void dumpResourceResponseMIMETypes(); + void dumpHistoryCallbacks(); + void dumpConfigurationForViewport(int availableWidth, int availableHeight); void setWillSendRequestReturnsNullOnRedirect(bool enabled); void setWillSendRequestReturnsNull(bool enabled); void setWillSendRequestClearHeader(const QStringList& headers); @@ -124,6 +126,7 @@ public slots: void grantDesktopNotificationPermission(const QString& origin); void ignoreDesktopNotificationPermissionRequests(); bool checkDesktopNotificationPermission(const QString& origin); + void simulateDesktopNotificationClick(const QString& title); void display(); void clearBackForwardList(); QString pathToLocalResource(const QString& url); @@ -135,6 +138,7 @@ public slots: void showWebInspector(); void closeWebInspector(); void evaluateInWebInspector(long callId, const QString& script); + void removeAllVisitedLinks(); void setMediaType(const QString& type); void setFrameFlatteningEnabled(bool enable); |