Skip to content
Permalink
Browse files
[Qt][WK1] Support better testing of Web Notifications
https://bugs.webkit.org/show_bug.cgi?id=107696

Reviewed by Jocelyn Turcotte.

Source/WebKit/qt:

Implement support for the DRT to clear notification permissions.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::clearNotificationPermissions):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationPresenterClientQt::clearCachedPermissions):
(WebCore):
* WebCoreSupport/NotificationPresenterClientQt.h:
(NotificationPresenterClientQt):

Tools:

Do not dump notification output to the console by default, instead allow the
tests that need this feature to enable it.

Implement denyWebNotificationPermission and removeAllWebNotificationPermissions.
Remove unused m_desktopNotificationAllowedOrigins variable.

* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunner::TestRunner):
(TestRunner::reset):
(TestRunner::dumpNotifications):
(TestRunner::grantWebNotificationPermission):
(TestRunner::denyWebNotificationPermission):
(TestRunner::removeAllWebNotificationPermissions):
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunner):

LayoutTests:

Unskip the now working tests in http/tests/notifications.
Skip four tests that still fail on WebKit1.
Update tests that need notifications dumped.

* fast/notifications/notifications-click-event.html:
* fast/notifications/notifications-display-close-events.html:
* fast/notifications/notifications-no-icon.html:
* fast/notifications/notifications-replace.html:
* fast/notifications/notifications-rtl.html:
* fast/notifications/notifications-with-permission.html:
* platform/qt-5.0-wk1/TestExpectations:
* platform/qt/TestExpectations:


Canonical link: https://commits.webkit.org/126541@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carewolf committed Jan 30, 2013
1 parent 26c94e2 commit 8c6cbbc0776b9c7d81c55f54ee37aa5f75dee702
Showing 17 changed files with 104 additions and 9 deletions.
@@ -1,3 +1,23 @@
2013-01-30 Allan Sandfeld Jensen <allan.jensen@digia.com>

[Qt][WK1] Support better testing of Web Notifications
https://bugs.webkit.org/show_bug.cgi?id=107696

Reviewed by Jocelyn Turcotte.

Unskip the now working tests in http/tests/notifications.
Skip four tests that still fail on WebKit1.
Update tests that need notifications dumped.

* fast/notifications/notifications-click-event.html:
* fast/notifications/notifications-display-close-events.html:
* fast/notifications/notifications-no-icon.html:
* fast/notifications/notifications-replace.html:
* fast/notifications/notifications-rtl.html:
* fast/notifications/notifications-with-permission.html:
* platform/qt-5.0-wk1/TestExpectations:
* platform/qt/TestExpectations:

2013-01-30 Andrey Lushnikov <lushnikov@chromium.org>

Web Inspector: implement highlight range API
@@ -12,6 +12,8 @@
if (window.testRunner) {
testRunner.grantWebNotificationPermission("file://");
testRunner.dumpAsText();
if (testRunner.dumpNotifications)
testRunner.dumpNotifications();
testRunner.waitUntilDone();
}

@@ -12,6 +12,8 @@
if (window.testRunner) {
testRunner.grantWebNotificationPermission("file://");
testRunner.dumpAsText();
if (testRunner.dumpNotifications)
testRunner.dumpNotifications();
testRunner.waitUntilDone();
}

@@ -12,6 +12,8 @@
if (window.testRunner) {
testRunner.grantWebNotificationPermission("file://");
testRunner.dumpAsText();
if (testRunner.dumpNotifications)
testRunner.dumpNotifications();
}

if (!window.webkitNotifications) {
@@ -12,6 +12,8 @@
if (window.testRunner) {
testRunner.grantWebNotificationPermission("file://");
testRunner.dumpAsText();
if (testRunner.dumpNotifications)
testRunner.dumpNotifications();
}

if (!window.webkitNotifications) {
@@ -12,6 +12,8 @@
if (window.testRunner) {
testRunner.grantWebNotificationPermission("file://");
testRunner.dumpAsText();
if (testRunner.dumpNotifications)
testRunner.dumpNotifications();
}

if (!window.webkitNotifications) {
@@ -12,6 +12,8 @@
if (window.testRunner) {
testRunner.grantWebNotificationPermission("file://");
testRunner.dumpAsText();
if (testRunner.dumpNotifications)
testRunner.dumpNotifications();
testRunner.waitUntilDone();
}

@@ -182,3 +182,9 @@ webkit.org/b/105158 compositing/tiling/crash-huge-layer.html

# [Qt][WK1] New fast/css/sticky/sticky-top-zoomed.html fails
webkit.org/b/105390 fast/css/sticky/sticky-top-zoomed.html

# [Qt] Web Notification tests failing due to missing methods in DRT.
webkit.org/b/95507 http/tests/notifications/events.html [ Failure ]
webkit.org/b/95507 http/tests/notifications/window-show-on-click.html [ Failure ]
webkit.org/b/95507 http/tests/notifications/legacy/events.html [ Failure ]
webkit.org/b/95507 http/tests/notifications/legacy/window-show-on-click.html [ Failure ]
@@ -2314,9 +2314,6 @@ svg/custom/clamped-masking-clipping.svg
# https://bugs.webkit.org/show_bug.cgi?id=95530
http/tests/security/inactive-document-with-empty-security-origin.html

# https://bugs.webkit.org/show_bug.cgi?id=95507
http/tests/notifications

# New fast/canvas/canvas-lineDash.html introduced in r128116 fails
# https://bugs.webkit.org/show_bug.cgi?id=96360
fast/canvas/canvas-lineDash.html
@@ -1,3 +1,21 @@
2013-01-30 Allan Sandfeld Jensen <allan.jensen@digia.com>

[Qt][WK1] Support better testing of Web Notifications
https://bugs.webkit.org/show_bug.cgi?id=107696

Reviewed by Jocelyn Turcotte.

Implement support for the DRT to clear notification permissions.

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::clearNotificationPermissions):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationPresenterClientQt::clearCachedPermissions):
(WebCore):
* WebCoreSupport/NotificationPresenterClientQt.h:
(NotificationPresenterClientQt):

2013-01-30 Huang Dongsung <luxtella@company100.net>

[TexMap] Remove GraphicsLayer in TextureMapperLayer.
@@ -1066,3 +1066,8 @@ QString DumpRenderTreeSupportQt::frameRenderTreeDump(QWebFrameAdapter* adapter)

return externalRepresentation(adapter->frame);
}

void DumpRenderTreeSupportQt::clearNotificationPermissions()
{
WebCore::NotificationPresenterClientQt::notificationPresenter()->clearCachedPermissions();
}
@@ -217,6 +217,7 @@ class QWEBKIT_EXPORT DumpRenderTreeSupportQt {
static void setSeamlessIFramesEnabled(bool);

static QString frameRenderTreeDump(QWebFrameAdapter*);
static void clearNotificationPermissions();
};

#endif
@@ -440,6 +440,11 @@ void NotificationPresenterClientQt::sendEvent(Notification* notification, const
notification->dispatchEvent(Event::create(eventName, false, true));
}

void NotificationPresenterClientQt::clearCachedPermissions()
{
m_cachedPermissions.clear();
}

void NotificationPresenterClientQt::removeReplacedNotificationFromQueue(Notification* notification)
{
Notification* oldNotification = 0;
@@ -118,6 +118,8 @@ class NotificationPresenterClientQt : public NotificationClient {
void notificationClicked(const QString& title);
void sendDisplayEvent(NotificationWrapper*);

void clearCachedPermissions();

private:
void sendEvent(Notification*, const AtomicString& eventName);
void displayNotification(Notification*);
@@ -1,3 +1,26 @@
2013-01-30 Allan Sandfeld Jensen <allan.jensen@digia.com>

[Qt][WK1] Support better testing of Web Notifications
https://bugs.webkit.org/show_bug.cgi?id=107696

Reviewed by Jocelyn Turcotte.

Do not dump notification output to the console by default, instead allow the
tests that need this feature to enable it.

Implement denyWebNotificationPermission and removeAllWebNotificationPermissions.
Remove unused m_desktopNotificationAllowedOrigins variable.

* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunner::TestRunner):
(TestRunner::reset):
(TestRunner::dumpNotifications):
(TestRunner::grantWebNotificationPermission):
(TestRunner::denyWebNotificationPermission):
(TestRunner::removeAllWebNotificationPermissions):
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunner):

2013-01-30 Jochen Eisinger <jochen@chromium.org>

[chromium] move methods from WebTestDelegate to WebTestRunner
@@ -31,6 +31,7 @@

#include "DumpRenderTreeQt.h"
#include "DumpRenderTreeSupportQt.h"
#include "NotificationPresenterClientQt.h"
#include "WorkQueue.h"
#include "WorkQueueItemQt.h"
#include <QCoreApplication>
@@ -45,7 +46,6 @@ TestRunner::TestRunner(WebCore::DumpRenderTree* drt)
, m_timeout(30000)
{
reset();
DumpRenderTreeSupportQt::dumpNotification(true);
}

void TestRunner::reset()
@@ -72,7 +72,6 @@ void TestRunner::reset()
m_webHistory = 0;
m_globalFlag = false;
m_userStyleSheetEnabled = false;
m_desktopNotificationAllowedOrigins.clear();
m_ignoreDesktopNotification = false;
m_isGeolocationPermissionSet = false;
m_isPrinting = false;
@@ -95,13 +94,20 @@ void TestRunner::reset()
DumpRenderTreeSupportQt::dumpHistoryCallbacks(false);
DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false);
DumpRenderTreeSupportQt::resetGeolocationMock(m_drt->pageAdapter());
DumpRenderTreeSupportQt::dumpNotification(false);
setIconDatabaseEnabled(false);
clearAllDatabases();
removeAllWebNotificationPermissions();
// The default state for DRT is to block third-party cookies, mimicing the Mac port
setAlwaysAcceptCookies(false);
emit hidePage();
}

void TestRunner::dumpNotifications()
{
DumpRenderTreeSupportQt::dumpNotification(true);
}

void TestRunner::processWork()
{
// qDebug() << ">>>processWork";
@@ -215,7 +221,6 @@ void TestRunner::grantWebNotificationPermission(const QString& origin)
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser);
m_desktopNotificationAllowedOrigins.append(origin);
}

void TestRunner::ignoreLegacyWebNotificationPermissionRequests()
@@ -225,12 +230,13 @@ void TestRunner::ignoreLegacyWebNotificationPermissionRequests()

void TestRunner::denyWebNotificationPermission(const QString& origin)
{
// FIXME: implement.
QWebFrame* frame = m_drt->webPage()->mainFrame();
m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionDeniedByUser);
}

void TestRunner::removeAllWebNotificationPermissions()
{
// FIXME: implement.
DumpRenderTreeSupportQt::clearNotificationPermissions();
}

void TestRunner::simulateWebNotificationClick(const QWebElement& notification)
@@ -108,6 +108,7 @@ public Q_SLOTS:
void dumpDatabaseCallbacks() { m_dumpDatabaseCallbacks = true; }
void dumpApplicationCacheDelegateCallbacks() { m_dumpApplicationCacheDelegateCallbacks = true; }
void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; }
void dumpNotifications();
void setCanOpenWindows() { m_canOpenWindows = true; }
void setPrinting() { m_isPrinting = true; }
void waitUntilDone();
@@ -315,7 +316,6 @@ private Q_SLOTS:
QWebFrame* m_topLoadingFrame;
WebCore::DumpRenderTree* m_drt;
QWebHistory* m_webHistory;
QStringList m_desktopNotificationAllowedOrigins;
bool m_ignoreDesktopNotification;

QByteArray m_audioData;

0 comments on commit 8c6cbbc

Please sign in to comment.