Title: [141259] trunk
Revision
141259
Author
[email protected]
Date
2013-01-30 05:59:04 -0800 (Wed, 30 Jan 2013)

Log Message

[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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (141258 => 141259)


--- trunk/LayoutTests/ChangeLog	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/ChangeLog	2013-01-30 13:59:04 UTC (rev 141259)
@@ -1,3 +1,23 @@
+2013-01-30  Allan Sandfeld Jensen  <[email protected]>
+
+        [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  <[email protected]>
 
         Web Inspector: implement highlight range API

Modified: trunk/LayoutTests/fast/notifications/notifications-click-event.html (141258 => 141259)


--- trunk/LayoutTests/fast/notifications/notifications-click-event.html	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/fast/notifications/notifications-click-event.html	2013-01-30 13:59:04 UTC (rev 141259)
@@ -12,6 +12,8 @@
             if (window.testRunner) {
                 testRunner.grantWebNotificationPermission("file://");
                 testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
                 testRunner.waitUntilDone();
             }
 

Modified: trunk/LayoutTests/fast/notifications/notifications-display-close-events.html (141258 => 141259)


--- trunk/LayoutTests/fast/notifications/notifications-display-close-events.html	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/fast/notifications/notifications-display-close-events.html	2013-01-30 13:59:04 UTC (rev 141259)
@@ -12,6 +12,8 @@
             if (window.testRunner) {
                 testRunner.grantWebNotificationPermission("file://");
                 testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
                 testRunner.waitUntilDone();
             }
 

Modified: trunk/LayoutTests/fast/notifications/notifications-no-icon.html (141258 => 141259)


--- trunk/LayoutTests/fast/notifications/notifications-no-icon.html	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/fast/notifications/notifications-no-icon.html	2013-01-30 13:59:04 UTC (rev 141259)
@@ -12,6 +12,8 @@
             if (window.testRunner) {
                 testRunner.grantWebNotificationPermission("file://");
                 testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
             }
 
             if (!window.webkitNotifications) {

Modified: trunk/LayoutTests/fast/notifications/notifications-replace.html (141258 => 141259)


--- trunk/LayoutTests/fast/notifications/notifications-replace.html	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/fast/notifications/notifications-replace.html	2013-01-30 13:59:04 UTC (rev 141259)
@@ -12,6 +12,8 @@
             if (window.testRunner) {
                 testRunner.grantWebNotificationPermission("file://");
                 testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
             }
 
             if (!window.webkitNotifications) {

Modified: trunk/LayoutTests/fast/notifications/notifications-rtl.html (141258 => 141259)


--- trunk/LayoutTests/fast/notifications/notifications-rtl.html	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/fast/notifications/notifications-rtl.html	2013-01-30 13:59:04 UTC (rev 141259)
@@ -12,6 +12,8 @@
             if (window.testRunner) {
                 testRunner.grantWebNotificationPermission("file://");
                 testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
             }
 
             if (!window.webkitNotifications) {

Modified: trunk/LayoutTests/fast/notifications/notifications-with-permission.html (141258 => 141259)


--- trunk/LayoutTests/fast/notifications/notifications-with-permission.html	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/fast/notifications/notifications-with-permission.html	2013-01-30 13:59:04 UTC (rev 141259)
@@ -12,6 +12,8 @@
             if (window.testRunner) {
                 testRunner.grantWebNotificationPermission("file://");
                 testRunner.dumpAsText();
+                if (testRunner.dumpNotifications)
+                    testRunner.dumpNotifications();
                 testRunner.waitUntilDone();
             }
 

Modified: trunk/LayoutTests/platform/qt/TestExpectations (141258 => 141259)


--- trunk/LayoutTests/platform/qt/TestExpectations	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/platform/qt/TestExpectations	2013-01-30 13:59:04 UTC (rev 141259)
@@ -2314,9 +2314,6 @@
 # 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

Modified: trunk/LayoutTests/platform/qt-5.0-wk1/TestExpectations (141258 => 141259)


--- trunk/LayoutTests/platform/qt-5.0-wk1/TestExpectations	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/LayoutTests/platform/qt-5.0-wk1/TestExpectations	2013-01-30 13:59:04 UTC (rev 141259)
@@ -182,3 +182,9 @@
 
 # [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 ]

Modified: trunk/Source/WebKit/qt/ChangeLog (141258 => 141259)


--- trunk/Source/WebKit/qt/ChangeLog	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Source/WebKit/qt/ChangeLog	2013-01-30 13:59:04 UTC (rev 141259)
@@ -1,3 +1,21 @@
+2013-01-30  Allan Sandfeld Jensen  <[email protected]>
+
+        [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  <[email protected]>
 
         [TexMap] Remove GraphicsLayer in TextureMapperLayer.

Modified: trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp (141258 => 141259)


--- trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp	2013-01-30 13:59:04 UTC (rev 141259)
@@ -1066,3 +1066,8 @@
 
     return externalRepresentation(adapter->frame);
 }
+
+void DumpRenderTreeSupportQt::clearNotificationPermissions()
+{
+    WebCore::NotificationPresenterClientQt::notificationPresenter()->clearCachedPermissions();
+}

Modified: trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h (141258 => 141259)


--- trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h	2013-01-30 13:59:04 UTC (rev 141259)
@@ -217,6 +217,7 @@
     static void setSeamlessIFramesEnabled(bool);
 
     static QString frameRenderTreeDump(QWebFrameAdapter*);
+    static void clearNotificationPermissions();
 };
 
 #endif

Modified: trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp (141258 => 141259)


--- trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp	2013-01-30 13:59:04 UTC (rev 141259)
@@ -440,6 +440,11 @@
         notification->dispatchEvent(Event::create(eventName, false, true));
 }
 
+void NotificationPresenterClientQt::clearCachedPermissions()
+{
+    m_cachedPermissions.clear();
+}
+
 void NotificationPresenterClientQt::removeReplacedNotificationFromQueue(Notification* notification)
 {
     Notification* oldNotification = 0;

Modified: trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h (141258 => 141259)


--- trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Source/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h	2013-01-30 13:59:04 UTC (rev 141259)
@@ -118,6 +118,8 @@
     void notificationClicked(const QString& title);
     void sendDisplayEvent(NotificationWrapper*);
 
+    void clearCachedPermissions();
+
 private:
     void sendEvent(Notification*, const AtomicString& eventName);
     void displayNotification(Notification*);

Modified: trunk/Tools/ChangeLog (141258 => 141259)


--- trunk/Tools/ChangeLog	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Tools/ChangeLog	2013-01-30 13:59:04 UTC (rev 141259)
@@ -1,3 +1,26 @@
+2013-01-30  Allan Sandfeld Jensen  <[email protected]>
+
+        [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  <[email protected]>
 
         [chromium] move methods from WebTestDelegate to WebTestRunner

Modified: trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp (141258 => 141259)


--- trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp	2013-01-30 13:59:04 UTC (rev 141259)
@@ -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 @@
     , m_timeout(30000)
 {
     reset();
-    DumpRenderTreeSupportQt::dumpNotification(true);
 }
 
 void TestRunner::reset()
@@ -72,7 +72,6 @@
     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 @@
     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 @@
 {
     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::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)

Modified: trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h (141258 => 141259)


--- trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h	2013-01-30 12:47:39 UTC (rev 141258)
+++ trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h	2013-01-30 13:59:04 UTC (rev 141259)
@@ -108,6 +108,7 @@
     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 @@
     QWebFrame* m_topLoadingFrame;
     WebCore::DumpRenderTree* m_drt;
     QWebHistory* m_webHistory;
-    QStringList m_desktopNotificationAllowedOrigins;
     bool m_ignoreDesktopNotification;
 
     QByteArray m_audioData;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to