diff options
Diffstat (limited to 'WebKitTools/DumpRenderTree/qt')
5 files changed, 32 insertions, 25 deletions
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index eadcc43..10a6af0 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -158,8 +158,8 @@ WebPage::WebPage(QObject* parent, DumpRenderTree* drt) setNetworkAccessManager(m_drt->networkAccessManager()); setPluginFactory(new TestPlugin(this)); - connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain))); - connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(cancelPermission(QWebFrame*, QWebPage::PermissionDomain))); + connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(requestPermission(QWebFrame*, QWebPage::Feature))); + connect(this, SIGNAL(featurePermissionRequestCanceled(QWebFrame*, QWebPage::Feature)), this, SLOT(cancelPermission(QWebFrame*, QWebPage::Feature))); } WebPage::~WebPage() @@ -219,19 +219,19 @@ void WebPage::javaScriptAlert(QWebFrame*, const QString& message) fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData()); } -void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain) +void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature) { - switch (domain) { - case NotificationsPermissionDomain: + switch (feature) { + case Notifications: if (!m_drt->layoutTestController()->ignoreReqestForPermission()) - setUserPermission(frame, domain, PermissionGranted); + setFeaturePermission(frame, feature, PermissionGrantedByUser); break; - case GeolocationPermissionDomain: + case Geolocation: if (m_drt->layoutTestController()->isGeolocationPermissionSet()) if (m_drt->layoutTestController()->geolocationPermission()) - setUserPermission(frame, domain, PermissionGranted); + setFeaturePermission(frame, feature, PermissionGrantedByUser); else - setUserPermission(frame, domain, PermissionDenied); + setFeaturePermission(frame, feature, PermissionDeniedByUser); else m_pendingGeolocationRequests.append(frame); break; @@ -240,10 +240,10 @@ void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain dom } } -void WebPage::cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain domain) +void WebPage::cancelPermission(QWebFrame* frame, QWebPage::Feature feature) { - switch (domain) { - case GeolocationPermissionDomain: + switch (feature) { + case Geolocation: m_pendingGeolocationRequests.removeOne(frame); break; default: @@ -251,17 +251,17 @@ void WebPage::cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain doma } } -void WebPage::permissionSet(QWebPage::PermissionDomain domain) +void WebPage::permissionSet(QWebPage::Feature feature) { - switch (domain) { - case GeolocationPermissionDomain: + switch (feature) { + case Geolocation: { Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet()); foreach (QWebFrame* frame, m_pendingGeolocationRequests) if (m_drt->layoutTestController()->geolocationPermission()) - setUserPermission(frame, domain, PermissionGranted); + setFeaturePermission(frame, feature, PermissionGrantedByUser); else - setUserPermission(frame, domain, PermissionDenied); + setFeaturePermission(frame, feature, PermissionDeniedByUser); m_pendingGeolocationRequests.clear(); break; @@ -576,7 +576,7 @@ static bool isWebInspectorTest(const QUrl& url) static bool shouldEnableDeveloperExtras(const QUrl& url) { - return isWebInspectorTest(url) || url.path().contains("inspector-enabled/"); + return true; } void DumpRenderTree::open(const QUrl& url) @@ -1077,7 +1077,7 @@ int DumpRenderTree::windowCount() const void DumpRenderTree::geolocationPermissionSet() { - m_page->permissionSet(QWebPage::GeolocationPermissionDomain); + m_page->permissionSet(QWebPage::Geolocation); } void DumpRenderTree::switchFocus(bool focused) diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h index 0382f96..283ebd9 100644 --- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h +++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h @@ -194,12 +194,12 @@ public: QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&); - void permissionSet(QWebPage::PermissionDomain domain); + void permissionSet(QWebPage::Feature feature); public slots: bool shouldInterruptJavaScript() { return false; } - void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain); - void cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain domain); + void requestPermission(QWebFrame* frame, QWebPage::Feature feature); + void cancelPermission(QWebFrame* frame, QWebPage::Feature feature); protected: bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type); diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp index 7135a1a..8b495be 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp @@ -198,7 +198,7 @@ int LayoutTestController::windowCount() void LayoutTestController::grantDesktopNotificationPermission(const QString& origin) { QWebFrame* frame = m_drt->webPage()->mainFrame(); - m_drt->webPage()->setUserPermission(frame, QWebPage::NotificationsPermissionDomain, QWebPage::PermissionGranted); + m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser); m_desktopNotificationAllowedOrigins.append(origin); } @@ -707,6 +707,11 @@ bool LayoutTestController::isCommandEnabled(const QString& name) const return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->webPage(), name); } +bool LayoutTestController::findString(const QString& string, const QStringList& optionArray) +{ + return DumpRenderTreeSupportQt::findString(m_drt->webPage(), string, optionArray); +} + QString LayoutTestController::markerTextForListItem(const QWebElement& listItem) { return DumpRenderTreeSupportQt::markerTextForListItem(listItem); @@ -768,7 +773,7 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy); } -void LayoutTestController::setMockSpeechInputResult(const QString& result, const QString& language) +void LayoutTestController::addMockSpeechInputResult(const QString& result, double confidence, const QString& language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h index 5c17624..9ba2364 100644 --- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h @@ -168,6 +168,7 @@ public slots: void setSelectTrailingWhitespaceEnabled(bool enable); void execCommand(const QString& name, const QString& value = QString()); bool isCommandEnabled(const QString& name) const; + bool findString(const QString& string, const QStringList& optionArray); bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId); bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId); @@ -218,7 +219,7 @@ public slots: bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; } bool geolocationPermission() const { return m_geolocationPermission; } - void setMockSpeechInputResult(const QString& result, const QString& language); + void addMockSpeechInputResult(const QString& result, double confidence, const QString& language); // Empty stub method to keep parity with object model exposed by global LayoutTestController. void abortModal() {} diff --git a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro index 1d460d7..de3cf6a 100644 --- a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro +++ b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro @@ -30,6 +30,7 @@ SOURCES = PluginObject.cpp \ TestObject.cpp \ Tests/DocumentOpenInDestroyStream.cpp \ Tests/EvaluateJSAfterRemovingPluginElement.cpp \ + Tests/GetUserAgentWithNullNPPFromNPPNew.cpp \ Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \ Tests/NPRuntimeRemoveProperty.cpp \ Tests/NullNPPGetValuePointer.cpp \ |