⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 126909 in webkit


Ignore:
Timestamp:
Aug 28, 2012, 12:08:32 PM (14 years ago)
Author:
jonlee@apple.com
Message:

Source/WebCore: [Mac] Add SPI to WK1 to retrieve internal IDs for web notifications
https://bugs.webkit.org/show_bug.cgi?id=95099
<rdar://problem/12180186>

Reviewed by Jessie Berlin.

This is work toward providing Mac support for web notifications in DRT and WTR (77969).

Expose functions to convert JSValue to Notification, and to get the NotificationController from a page.

  • WebCore.exp.in:
  • WebCore.xcodeproj/project.pbxproj: Promote NotificationController.h and JSNotification.h to private headers.

Source/WebKit/mac: [Mac] Add SPI to WK1 to retrieve internal IDs for web notifications
https://bugs.webkit.org/show_bug.cgi?id=95099
<rdar://problem/12180186>

Reviewed by Jessie Berlin.

This is work toward providing Mac support for web notifications in DRT and WTR (77969).

Add function to retrieve the internal ID for a notification. This is needed by layout tests to support simulating
a user click on a notification.

  • WebCoreSupport/WebNotificationClient.h:

(WebNotificationClient):

  • WebCoreSupport/WebNotificationClient.mm:

(WebNotificationClient::notificationIDForTesting): Converts the JS notification to a WebCore notification, and passes
that to [WebView _notificationIDForTesting:].

  • WebView/WebView.mm:

(-[WebView _notificationIDForTesting:]): Retrieves the notification ID based on the WebCore notification instance.

  • WebView/WebViewPrivate.h:

Tools: Update TestRunner API for web notifications
https://bugs.webkit.org/show_bug.cgi?id=95093
<rdar://problem/12179649>

Reviewed by Jessie Berlin.

This is work toward providing Mac support for web notifications in DRT and WTR (77969).

Some of the legacy APIs are less than ideal, and not tenable with the WTR infrastructure.
This first patch renames the TestRunner calls to use the term "web notifications" instead of
"desktop notifications", deprecates a couple API calls that are not used by anyone, and adds
additional calls that will be used in the tests that test the standard API.

  • DumpRenderTree/TestRunner.h:

(TestRunner): For consistency, rename a couple member variables. Remove unused checkDesktopNotificationPermission()
and areDesktopNotificationPermissionRequestsIgnored(). Remove origin mapping since each port implements its own solution.

  • DumpRenderTree/TestRunner.cpp: Push grantWebNotificationPermission() to individual ports.

(TestRunner::TestRunner):
(ignoreLegacyWebNotificationPermissionRequestsCallback): Renamed.
(simulateLegacyWebNotificationClickCallback): Renamed.
(grantWebNotificationPermissionCallback): Renamed.
(denyWebNotificationPermissionCallback): Added.
(removeAllWebNotificationPermissionsCallback): Added.
(simulateWebNotificationClickCallback): Added.
(TestRunner::staticFunctions):
(TestRunner::ignoreLegacyWebNotificationPermissionRequests):

  • DumpRenderTree/chromium/DRTTestRunner.cpp:

(DRTTestRunner::DRTTestRunner): Added bindings for new APIs.
(DRTTestRunner::grantWebNotificationPermission):
(DRTTestRunner::denyWebNotificationPermission): Stub.
(DRTTestRunner::removeAllWebNotificationPermissions): Stub.
(DRTTestRunner::simulateWebNotificationClick): Stub.
(DRTTestRunner::simulateLegacyWebNotificationClick):

  • DumpRenderTree/chromium/DRTTestRunner.h:

(DRTTestRunner):

Added stubs.

  • DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
  • DumpRenderTree/efl/TestRunnerEfl.cpp:
  • DumpRenderTree/gtk/TestRunnerGtk.cpp:
  • DumpRenderTree/mac/TestRunnerMac.mm: Later patch will contain implementation of this API.
  • DumpRenderTree/qt/TestRunnerQt.cpp: Added Qt-based stubs.
  • DumpRenderTree/win/TestRunnerWin.cpp:

LayoutTests: Update TestRunner API for web notifications
https://bugs.webkit.org/show_bug.cgi?id=95093
<rdar://problem/12179649>

Reviewed by Jessie Berlin.

This is work toward providing Mac support for web notifications in DRT and WTR (77969).

Refactor the tests to use the renamed legacy API calls.

  • fast/notifications/notifications-check-permission.html:
  • fast/notifications/notifications-click-event-focus.html:
  • fast/notifications/notifications-click-event.html:
  • fast/notifications/notifications-display-close-events.html:
  • fast/notifications/notifications-document-close-crash.html: Also, convert from Windows to UNIX line endings.
  • fast/notifications/notifications-double-show.html:
  • fast/notifications/notifications-event-stop-propagation.html-disabled:
  • fast/notifications/notifications-multi-events.html-disabled:
  • fast/notifications/notifications-no-icon.html:
  • fast/notifications/notifications-replace.html:
  • fast/notifications/notifications-rtl.html:
  • fast/notifications/notifications-with-permission.html:
  • fast/notifications/notifications-without-permission.html:
  • fast/notifications/resources/notifications-cancel-request-permission.html:
  • platform/qt-5.0-wk2/Skipped:
Location:
trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126908 r126909  
     12012-08-24  Jon Lee  <jonlee@apple.com>
     2
     3        Update TestRunner API for web notifications
     4        https://bugs.webkit.org/show_bug.cgi?id=95093
     5        <rdar://problem/12179649>
     6
     7        Reviewed by Jessie Berlin.
     8
     9        This is work toward providing Mac support for web notifications in DRT and WTR (77969).
     10
     11        Refactor the tests to use the renamed legacy API calls.
     12
     13        * fast/notifications/notifications-check-permission.html:
     14        * fast/notifications/notifications-click-event-focus.html:
     15        * fast/notifications/notifications-click-event.html:
     16        * fast/notifications/notifications-display-close-events.html:
     17        * fast/notifications/notifications-document-close-crash.html: Also, convert from Windows to UNIX line endings.
     18        * fast/notifications/notifications-double-show.html:
     19        * fast/notifications/notifications-event-stop-propagation.html-disabled:
     20        * fast/notifications/notifications-multi-events.html-disabled:
     21        * fast/notifications/notifications-no-icon.html:
     22        * fast/notifications/notifications-replace.html:
     23        * fast/notifications/notifications-rtl.html:
     24        * fast/notifications/notifications-with-permission.html:
     25        * fast/notifications/notifications-without-permission.html:
     26        * fast/notifications/resources/notifications-cancel-request-permission.html:
     27        * platform/qt-5.0-wk2/Skipped:
     28
    1292012-08-28  Dominic Mazzoni  <dmazzoni@google.com>
    230
  • trunk/LayoutTests/fast/notifications/notifications-check-permission.html

    r124410 r126909  
    2626           
    2727            if (window.testRunner) {
    28                 testRunner.grantDesktopNotificationPermission("file://");
     28                testRunner.grantWebNotificationPermission("file://");
    2929            }
    3030           
  • trunk/LayoutTests/fast/notifications/notifications-click-event-focus.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515                testRunner.waitUntilDone();
     
    3333
    3434            if (window.testRunner) {
    35                 testRunner.simulateDesktopNotificationClick("New E-mail");
     35                testRunner.simulateLegacyWebNotificationClick("New E-mail");
    3636                testRunner.notifyDone();
    3737            }
  • trunk/LayoutTests/fast/notifications/notifications-click-event.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515                testRunner.waitUntilDone();
     
    2424            N.show();
    2525            if (window.testRunner) {
    26                 testRunner.simulateDesktopNotificationClick("New E-mail");
     26                testRunner.simulateLegacyWebNotificationClick("New E-mail");
    2727                testRunner.notifyDone();
    2828            }
  • trunk/LayoutTests/fast/notifications/notifications-display-close-events.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515                testRunner.waitUntilDone();
  • trunk/LayoutTests/fast/notifications/notifications-document-close-crash.html

    r124410 r126909  
    77                testRunner.dumpAsText();
    88                testRunner.setCanOpenWindows();
    9                 testRunner.grantDesktopNotificationPermission("file://");
     9                testRunner.grantWebNotificationPermission("file://");
    1010                testRunner.waitUntilDone();
    1111            }
    12            
     12
    1313            if (!window.webkitNotifications) {
    1414                log("FAIL: No webkitNotifications interface!");
     
    2929                    {
    3030                        a.push(new WebGLByteArray());
    31                     } 
     31                    }
    3232                    catch (e) {}
    3333                    a.push(Array(i).join("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"));
     
    3636                notification.requestPermission();
    3737            }
    38            
     38
    3939            function finish()
    4040            {
  • trunk/LayoutTests/fast/notifications/notifications-double-show.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515                testRunner.waitUntilDone();
  • trunk/LayoutTests/fast/notifications/notifications-event-stop-propagation.html-disabled

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515            }
  • trunk/LayoutTests/fast/notifications/notifications-multi-events.html-disabled

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515            }
  • trunk/LayoutTests/fast/notifications/notifications-no-icon.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515            }
  • trunk/LayoutTests/fast/notifications/notifications-replace.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515            }
  • trunk/LayoutTests/fast/notifications/notifications-rtl.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515            }
  • trunk/LayoutTests/fast/notifications/notifications-with-permission.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 testRunner.grantDesktopNotificationPermission("file://");
     13                testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515                testRunner.waitUntilDone();
  • trunk/LayoutTests/fast/notifications/notifications-without-permission.html

    r124410 r126909  
    1111        {
    1212            if (window.testRunner) {
    13                 // NO PERMISSION testRunner.grantDesktopNotificationPermission("file://");
     13                // NO PERMISSION testRunner.grantWebNotificationPermission("file://");
    1414                testRunner.dumpAsText();
    1515            }
  • trunk/LayoutTests/fast/notifications/resources/notifications-cancel-request-permission.html

    r124410 r126909  
    1414
    1515            if (window.testRunner) {
    16                 testRunner.ignoreDesktopNotificationPermissionRequests();
     16                testRunner.ignoreLegacyWebNotificationPermissionRequests();
    1717            }
    1818
  • trunk/LayoutTests/platform/qt-5.0-wk2/Skipped

    r126751 r126909  
    142142http/tests/websocket/tests/hixie76/bad-sub-protocol-non-ascii.html
    143143
    144 # layoutTestController.ignoreDesktopNotificationPermissionRequests is unimplemented
     144# layoutTestController.ignoreLegacyWebNotificationPermissionRequests is unimplemented
    145145fast/notifications
    146146
  • trunk/Source/WebCore/ChangeLog

    r126908 r126909  
     12012-08-27  Jon Lee  <jonlee@apple.com>
     2
     3        [Mac] Add SPI to WK1 to retrieve internal IDs for web notifications
     4        https://bugs.webkit.org/show_bug.cgi?id=95099
     5        <rdar://problem/12180186>
     6
     7        Reviewed by Jessie Berlin.
     8
     9        This is work toward providing Mac support for web notifications in DRT and WTR (77969).
     10
     11        Expose functions to convert JSValue to Notification, and to get the NotificationController from a page.
     12
     13        * WebCore.exp.in:
     14        * WebCore.xcodeproj/project.pbxproj: Promote NotificationController.h and JSNotification.h to private headers.
     15
    1162012-08-28  Dominic Mazzoni  <dmazzoni@google.com>
    217
  • trunk/Source/WebCore/WebCore.exp.in

    r126444 r126909  
    23242324__ZN7WebCore12Notification18dispatchCloseEventEv
    23252325__ZN7WebCore12Notification18dispatchErrorEventEv
     2326__ZN7WebCore14toNotificationEN3JSC7JSValueE
    23262327__ZN7WebCore19provideNotificationEPNS_4PageEPNS_18NotificationClientE
     2328__ZN7WebCore22NotificationController10clientFromEPNS_4PageE
    23272329#endif
    23282330
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r126857 r126909  
    870870                31288E750E3005D6003619AE /* WebKitCSSKeyframesRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 31288E710E3005D6003619AE /* WebKitCSSKeyframesRule.h */; };
    871871                3128CA68147331520074C72A /* NotificationController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3128CA67147331520074C72A /* NotificationController.cpp */; };
    872                 3128CA6B147331630074C72A /* NotificationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3128CA6A147331630074C72A /* NotificationController.h */; };
     872                3128CA6B147331630074C72A /* NotificationController.h in Headers */ = {isa = PBXBuildFile; fileRef = 3128CA6A147331630074C72A /* NotificationController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    873873                312C0C41146DC6CC0016C911 /* Notification.h in Headers */ = {isa = PBXBuildFile; fileRef = 333F704F0FB49CA2008E12A6 /* Notification.h */; settings = {ATTRIBUTES = (Private, ); }; };
    874874                312D67B11535691F00563D0D /* Dictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 312D67B01535691F00563D0D /* Dictionary.cpp */; };
     
    953953                33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    954954                33503CA310179AD7003B47E1 /* JSNotification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503C9F10179AD7003B47E1 /* JSNotification.cpp */; };
    955                 33503CA410179AD7003B47E1 /* JSNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA010179AD7003B47E1 /* JSNotification.h */; };
     955                33503CA410179AD7003B47E1 /* JSNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA010179AD7003B47E1 /* JSNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
    956956                33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503CA110179AD7003B47E1 /* JSNotificationCenter.cpp */; };
    957957                33503CA610179AD7003B47E1 /* JSNotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA210179AD7003B47E1 /* JSNotificationCenter.h */; };
  • trunk/Source/WebKit/mac/ChangeLog

    r126837 r126909  
     12012-08-28  Jon Lee  <jonlee@apple.com>
     2
     3        [Mac] Add SPI to WK1 to retrieve internal IDs for web notifications
     4        https://bugs.webkit.org/show_bug.cgi?id=95099
     5        <rdar://problem/12180186>
     6
     7        Reviewed by Jessie Berlin.
     8
     9        This is work toward providing Mac support for web notifications in DRT and WTR (77969).
     10
     11        Add function to retrieve the internal ID for a notification. This is needed by layout tests to support simulating
     12        a user click on a notification.
     13
     14        * WebCoreSupport/WebNotificationClient.h:
     15        (WebNotificationClient):
     16        * WebCoreSupport/WebNotificationClient.mm:
     17        (WebNotificationClient::notificationIDForTesting): Converts the JS notification to a WebCore notification, and passes
     18        that to [WebView _notificationIDForTesting:].
     19        * WebView/WebView.mm:
     20        (-[WebView _notificationIDForTesting:]): Retrieves the notification ID based on the WebCore notification instance.
     21        * WebView/WebViewPrivate.h:
     22
    1232012-08-27  Sheriff Bot  <webkit.review.bot@gmail.com>
    224
  • trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h

    r115943 r126909  
    4949    WebView *webView() { return m_webView; }
    5050
     51#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     52    // For testing purposes.
     53    uint64_t notificationIDForTesting(WebCore::Notification*);
     54#endif
     55
    5156private:
    5257    virtual bool show(WebCore::Notification*) OVERRIDE;
  • trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm

    r126837 r126909  
    231231
    232232#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
     233uint64_t WebNotificationClient::notificationIDForTesting(WebCore::Notification* notification)
     234{
     235    return [m_notificationMap.get(notification).get() notificationID];
     236}
     237
    233238@implementation WebNotificationPolicyListener
    234239
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r126343 r126909  
    144144#import <WebCore/JSElement.h>
    145145#import <WebCore/JSNodeList.h>
     146#import <WebCore/JSNotification.h>
    146147#import <WebCore/Logging.h>
    147148#import <WebCore/MemoryPressureHandler.h>
    148149#import <WebCore/MIMETypeRegistry.h>
    149150#import <WebCore/NodeList.h>
     151#import <WebCore/Notification.h>
     152#import <WebCore/NotificationController.h>
    150153#import <WebCore/Page.h>
    151154#import <WebCore/PageCache.h>
     
    65476550    [[self _notificationProvider] webView:self didCloseNotifications:notificationIDs];
    65486551}
     6552
     6553- (uint64_t)_notificationIDForTesting:(JSValueRef)jsNotification
     6554{
     6555    JSContextRef context = [[self mainFrame] globalContext];
     6556    WebCore::Notification* notification = toNotification(toJS(toJS(context), jsNotification));
     6557    return static_cast<WebNotificationClient*>(NotificationController::clientFrom(_private->page))->notificationIDForTesting(notification);
     6558}
    65496559@end
    65506560
  • trunk/Source/WebKit/mac/WebView/WebViewPrivate.h

    r123674 r126909  
    740740- (void)_notificationDidClick:(uint64_t)notificationID;
    741741- (void)_notificationsDidClose:(NSArray *)notificationIDs;
     742
     743- (uint64_t)_notificationIDForTesting:(JSValueRef)jsNotification;
    742744@end
    743745
  • trunk/Tools/ChangeLog

    r126905 r126909  
     12012-08-27  Jon Lee  <jonlee@apple.com>
     2
     3        Update TestRunner API for web notifications
     4        https://bugs.webkit.org/show_bug.cgi?id=95093
     5        <rdar://problem/12179649>
     6
     7        Reviewed by Jessie Berlin.
     8
     9        This is work toward providing Mac support for web notifications in DRT and WTR (77969).
     10
     11        Some of the legacy APIs are less than ideal, and not tenable with the WTR infrastructure.
     12        This first patch renames the TestRunner calls to use the term "web notifications" instead of
     13        "desktop notifications", deprecates a couple API calls that are not used by anyone, and adds
     14        additional calls that will be used in the tests that test the standard API.
     15
     16        * DumpRenderTree/TestRunner.h:
     17        (TestRunner): For consistency, rename a couple member variables. Remove unused checkDesktopNotificationPermission()
     18        and areDesktopNotificationPermissionRequestsIgnored(). Remove origin mapping since each port implements its own solution.
     19        * DumpRenderTree/TestRunner.cpp: Push grantWebNotificationPermission() to individual ports.
     20        (TestRunner::TestRunner):
     21        (ignoreLegacyWebNotificationPermissionRequestsCallback): Renamed.
     22        (simulateLegacyWebNotificationClickCallback): Renamed.
     23        (grantWebNotificationPermissionCallback): Renamed.
     24        (denyWebNotificationPermissionCallback): Added.
     25        (removeAllWebNotificationPermissionsCallback): Added.
     26        (simulateWebNotificationClickCallback): Added.
     27        (TestRunner::staticFunctions):
     28        (TestRunner::ignoreLegacyWebNotificationPermissionRequests):
     29
     30        * DumpRenderTree/chromium/DRTTestRunner.cpp:
     31        (DRTTestRunner::DRTTestRunner): Added bindings for new APIs.
     32        (DRTTestRunner::grantWebNotificationPermission):
     33        (DRTTestRunner::denyWebNotificationPermission): Stub.
     34        (DRTTestRunner::removeAllWebNotificationPermissions): Stub.
     35        (DRTTestRunner::simulateWebNotificationClick): Stub.
     36        (DRTTestRunner::simulateLegacyWebNotificationClick):
     37        * DumpRenderTree/chromium/DRTTestRunner.h:
     38        (DRTTestRunner):
     39
     40        Added stubs.
     41        * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
     42        * DumpRenderTree/efl/TestRunnerEfl.cpp:
     43        * DumpRenderTree/gtk/TestRunnerGtk.cpp:
     44        * DumpRenderTree/mac/TestRunnerMac.mm: Later patch will contain implementation of this API.
     45        * DumpRenderTree/qt/TestRunnerQt.cpp: Added Qt-based stubs.
     46        * DumpRenderTree/win/TestRunnerWin.cpp:
     47
    1482012-08-28  Szilard Ledan  <szledan@inf.u-szeged.hu>
    249
  • trunk/Tools/DumpRenderTree/TestRunner.cpp

    r125516 r126909  
    9393    , m_shouldPaintBrokenImage(true)
    9494    , m_shouldStayOnPageAfterHandlingBeforeUnload(false)
    95     , m_areDesktopNotificationPermissionRequestsIgnored(false)
     95    , m_areLegacyWebNotificationPermissionRequestsIgnored(false)
    9696    , m_customFullScreenBehavior(false)
    9797    , m_testPathOrURL(testPathOrURL)
     
    646646    controller->goBack();
    647647   
    648     return JSValueMakeUndefined(context);
    649 }
    650 
    651 static JSValueRef grantDesktopNotificationPermissionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    652 {
    653     // Has Windows implementation
    654     if (argumentCount < 1)
    655         return JSValueMakeUndefined(context);
    656 
    657     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
    658 
    659     controller->grantDesktopNotificationPermission(JSValueToStringCopy(context, arguments[0], NULL));
    660        
    661648    return JSValueMakeUndefined(context);
    662649}
     
    21352122}
    21362123
    2137 static JSValueRef ignoreDesktopNotificationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    2138 {
    2139     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
    2140     controller->ignoreDesktopNotificationPermissionRequests();
    2141     return JSValueMakeUndefined(context);
    2142 }
    2143 
    2144 static JSValueRef simulateDesktopNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     2124static JSValueRef ignoreLegacyWebNotificationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     2125{
     2126    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
     2127    controller->ignoreLegacyWebNotificationPermissionRequests();
     2128    return JSValueMakeUndefined(context);
     2129}
     2130
     2131static JSValueRef simulateLegacyWebNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    21452132{
    21462133    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
    21472134    JSRetainPtr<JSStringRef> title(Adopt, JSValueToStringCopy(context, arguments[0], exception));
    2148     controller->simulateDesktopNotificationClick(title.get());
     2135    controller->simulateLegacyWebNotificationClick(title.get());
    21492136    return JSValueMakeUndefined(context);
    21502137}
     
    21972184    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
    21982185    controller->setStorageDatabaseIdleInterval(interval);
     2186
     2187    return JSValueMakeUndefined(context);
     2188}
     2189
     2190static JSValueRef grantWebNotificationPermissionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     2191{
     2192    if (argumentCount < 1)
     2193        return JSValueMakeUndefined(context);
     2194
     2195    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
     2196
     2197    JSRetainPtr<JSStringRef> origin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
     2198    ASSERT(!*exception);
     2199    controller->grantWebNotificationPermission(origin.get());
     2200
     2201    return JSValueMakeUndefined(context);
     2202}
     2203
     2204
     2205static JSValueRef denyWebNotificationPermissionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     2206{
     2207    if (argumentCount < 1)
     2208        return JSValueMakeUndefined(context);
     2209
     2210    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
     2211
     2212    JSRetainPtr<JSStringRef> origin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
     2213    ASSERT(!*exception);
     2214    controller->denyWebNotificationPermission(origin.get());
     2215
     2216    return JSValueMakeUndefined(context);
     2217}
     2218
     2219
     2220static JSValueRef removeAllWebNotificationPermissionsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     2221{
     2222    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
     2223
     2224    controller->removeAllWebNotificationPermissions();
     2225
     2226    return JSValueMakeUndefined(context);
     2227}
     2228
     2229
     2230static JSValueRef simulateWebNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
     2231{
     2232    // Has Windows implementation
     2233    if (argumentCount < 1)
     2234        return JSValueMakeUndefined(context);
     2235
     2236    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
     2237
     2238    controller->simulateWebNotificationClick(arguments[0]);
    21992239
    22002240    return JSValueMakeUndefined(context);
     
    23032343        { "originsWithApplicationCache", originsWithApplicationCacheCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    23042344        { "goBack", goBackCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    2305         { "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    2306         { "ignoreDesktopNotificationPermissionRequests", ignoreDesktopNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     2345        { "ignoreLegacyWebNotificationPermissionRequests", ignoreLegacyWebNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    23072346        { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    23082347        { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     
    23932432        { "setAsynchronousSpellCheckingEnabled", setAsynchronousSpellCheckingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    23942433        { "showWebInspector", showWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    2395         { "simulateDesktopNotificationClick", simulateDesktopNotificationClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     2434        { "simulateLegacyWebNotificationClick", simulateLegacyWebNotificationClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    23962435        { "testOnscreen", testOnscreenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    23972436        { "testRepaint", testRepaintCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     
    24182457        { "setHasCustomFullScreenBehavior", setHasCustomFullScreenBehaviorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    24192458        { "setStorageDatabaseIdleInterval", setStorageDatabaseIdleIntervalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     2459        { "grantWebNotificationPermission", grantWebNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     2460        { "denyWebNotificationPermission", denyWebNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     2461        { "removeAllWebNotificationPermissions", removeAllWebNotificationPermissionsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
     2462        { "simulateWebNotificationClick", simulateWebNotificationClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    24202463        { 0, 0, 0 }
    24212464    };
     
    24592502}
    24602503
    2461 void TestRunner::grantDesktopNotificationPermission(JSStringRef origin)
    2462 {
    2463     m_desktopNotificationAllowedOrigins.push_back(JSStringRetain(origin));
    2464 }
    2465 
    2466 bool TestRunner::checkDesktopNotificationPermission(JSStringRef origin)
    2467 {
    2468     std::vector<JSStringRef>::iterator i;
    2469     for (i = m_desktopNotificationAllowedOrigins.begin();
    2470          i != m_desktopNotificationAllowedOrigins.end();
    2471          ++i) {
    2472         if (JSStringIsEqual(*i, origin))
    2473             return true;
    2474     }
    2475     return false;
    2476 }
    2477 
    2478 void TestRunner::ignoreDesktopNotificationPermissionRequests()
    2479 {
    2480     m_areDesktopNotificationPermissionRequestsIgnored = false;
     2504void TestRunner::ignoreLegacyWebNotificationPermissionRequests()
     2505{
     2506    m_areLegacyWebNotificationPermissionRequestsIgnored = false;
    24812507}
    24822508
  • trunk/Tools/DumpRenderTree/TestRunner.h

    r125516 r126909  
    137137#endif
    138138
    139     void grantDesktopNotificationPermission(JSStringRef origin);
    140     bool checkDesktopNotificationPermission(JSStringRef origin);
    141     void ignoreDesktopNotificationPermissionRequests();
    142     bool areDesktopNotificationPermissionRequestsIgnored() const { return m_areDesktopNotificationPermissionRequestsIgnored; }
    143     void simulateDesktopNotificationClick(JSStringRef title);
     139    void ignoreLegacyWebNotificationPermissionRequests();
     140    void simulateLegacyWebNotificationClick(JSStringRef title);
     141    void grantWebNotificationPermission(JSStringRef origin);
     142    void denyWebNotificationPermission(JSStringRef origin);
     143    void removeAllWebNotificationPermissions();
     144    void simulateWebNotificationClick(JSValueRef notification);
    144145
    145146    bool elementDoesAutoCompleteForElementWithId(JSStringRef id);
     
    418419    bool m_shouldPaintBrokenImage;
    419420    bool m_shouldStayOnPageAfterHandlingBeforeUnload;
    420     bool m_areDesktopNotificationPermissionRequestsIgnored;
     421    bool m_areLegacyWebNotificationPermissionRequestsIgnored;
    421422    bool m_customFullScreenBehavior;
    422423
     
    431432    // base64 encoded WAV audio data is stored here.
    432433    std::string m_encodedAudioData;
    433    
    434     // origins which have been granted desktop notification access
    435     std::vector<JSStringRef> m_desktopNotificationAllowedOrigins;
    436434
    437435    std::map<std::string, std::string> m_URLsToRedirect;
  • trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp

    r125516 r126909  
    819819}
    820820
    821 void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
     821void TestRunner::grantWebNotificationPermission(JSStringRef origin)
     822{
     823}
     824
     825void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin)
     826{
     827}
     828
     829void TestRunner::removeAllWebNotificationPermissions()
     830{
     831}
     832
     833void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification)
     834{
     835}
     836
     837void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title)
    822838{
    823839}
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp

    r125516 r126909  
    156156    bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors);
    157157#if ENABLE(NOTIFICATIONS)
    158     bindMethod("grantDesktopNotificationPermission", &DRTTestRunner::grantDesktopNotificationPermission);
     158    bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission);
     159    bindMethod("denyWebNotificationPermission", &DRTTestRunner::denyWebNotificationPermission);
     160    bindMethod("removeAllWebNotificationPermissions", &DRTTestRunner::removeAllWebNotificationPermissions);
     161    bindMethod("simulateWebNotificationClick", &DRTTestRunner::simulateWebNotificationClick);
    159162#endif
    160163    bindMethod("findString", &DRTTestRunner::findString);
     
    234237    bindMethod("showWebInspector", &DRTTestRunner::showWebInspector);
    235238#if ENABLE(NOTIFICATIONS)
    236     bindMethod("simulateDesktopNotificationClick", &DRTTestRunner::simulateDesktopNotificationClick);
     239    bindMethod("simulateLegacyWebNotificationClick", &DRTTestRunner::simulateLegacyWebNotificationClick);
    237240#endif
    238241    bindMethod("startSpeechInput", &DRTTestRunner::startSpeechInput);
     
    11791182
    11801183#if ENABLE(NOTIFICATIONS)
    1181 void DRTTestRunner::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
     1184void DRTTestRunner::grantWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
    11821185{
    11831186    if (arguments.size() != 1 || !arguments[0].isString()) {
     
    11911194}
    11921195
    1193 void DRTTestRunner::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result)
     1196void DRTTestRunner::denyWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
     1197{
     1198    // FIXME: Implement.
     1199    result->setNull();
     1200}
     1201
     1202void DRTTestRunner::removeAllWebNotificationPermissions(const CppArgumentList& arguments, CppVariant* result)
     1203{
     1204    // FIXME: Implement.
     1205    result->setNull();
     1206}
     1207
     1208void DRTTestRunner::simulateWebNotificationClick(const CppArgumentList& arguments, CppVariant* result)
     1209{
     1210    // FIXME: Implement.
     1211    result->setNull();
     1212}
     1213
     1214void DRTTestRunner::simulateLegacyWebNotificationClick(const CppArgumentList& arguments, CppVariant* result)
    11941215{
    11951216    if (arguments.size() != 1 || !arguments[0].isString()) {
  • trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h

    r125516 r126909  
    235235#if ENABLE(NOTIFICATIONS)
    236236    // Grants permission for desktop notifications to an origin
    237     void grantDesktopNotificationPermission(const CppArgumentList&, CppVariant*);
     237    void grantWebNotificationPermission(const CppArgumentList&, CppVariant*);
     238    void denyWebNotificationPermission(const CppArgumentList&, CppVariant*);
     239    void removeAllWebNotificationPermissions(const CppArgumentList&, CppVariant*);
     240    void simulateWebNotificationClick(const CppArgumentList&, CppVariant*);
    238241    // Simulates a click on a desktop notification.
    239     void simulateDesktopNotificationClick(const CppArgumentList&, CppVariant*);
     242    void simulateLegacyWebNotificationClick(const CppArgumentList&, CppVariant*);
    240243#endif
    241244
  • trunk/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp

    r125516 r126909  
    881881}
    882882
    883 void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
     883void TestRunner::grantWebNotificationPermission(JSStringRef origin)
     884{
     885}
     886
     887void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin)
     888{
     889}
     890
     891void TestRunner::removeAllWebNotificationPermissions()
     892{
     893}
     894
     895void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification)
     896{
     897}
     898
     899void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title)
    884900{
    885901}
  • trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp

    r125516 r126909  
    968968}
    969969
    970 void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
     970void TestRunner::grantWebNotificationPermission(JSStringRef origin)
     971{
     972}
     973
     974void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin)
     975{
     976}
     977
     978void TestRunner::removeAllWebNotificationPermissions()
     979{
     980}
     981
     982void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification)
     983{
     984}
     985
     986void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title)
    971987{
    972988}
  • trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm

    r125516 r126909  
    11641164}
    11651165
    1166 void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
     1166void TestRunner::simulateLegacyWebNotificationClick(JSStringRef jsTitle)
     1167{
     1168}
     1169
     1170void TestRunner::resetPageVisibility()
    11671171{
    11681172    // FIXME: Implement.
    11691173}
    11701174
    1171 void TestRunner::resetPageVisibility()
     1175void TestRunner::setPageVisibility(const char*)
    11721176{
    11731177    // FIXME: Implement.
    11741178}
    11751179
    1176 void TestRunner::setPageVisibility(const char*)
     1180void TestRunner::sendWebIntentResponse(JSStringRef)
    11771181{
    11781182    // FIXME: Implement.
    11791183}
    11801184
    1181 void TestRunner::sendWebIntentResponse(JSStringRef)
     1185void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
    11821186{
    11831187    // FIXME: Implement.
    11841188}
    11851189
    1186 void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef)
    1187 {
    1188     // FIXME: Implement.
    1189 }
     1190
     1191void TestRunner::grantWebNotificationPermission(JSStringRef jsOrigin)
     1192{
     1193}
     1194
     1195void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin)
     1196{
     1197}
     1198
     1199void TestRunner::removeAllWebNotificationPermissions()
     1200{
     1201}
     1202
     1203void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification)
     1204{
     1205}
     1206
  • trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp

    r125516 r126909  
    203203}
    204204
    205 void TestRunner::grantDesktopNotificationPermission(const QString& origin)
     205void TestRunner::grantWebNotificationPermission(const QString& origin)
    206206{
    207207    QWebFrame* frame = m_drt->webPage()->mainFrame();
     
    210210}
    211211
    212 void TestRunner::ignoreDesktopNotificationPermissionRequests()
     212void TestRunner::ignoreLegacyWebNotificationPermissionRequests()
    213213{
    214214    m_ignoreDesktopNotification = true;
    215215}
    216216
    217 bool TestRunner::checkDesktopNotificationPermission(const QString& origin)
    218 {
    219     return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin);
    220 }
    221 
    222 void TestRunner::simulateDesktopNotificationClick(const QString& title)
     217void TestRunner::denyWebNotificationPermission(const QString& origin)
     218{
     219    // FIXME: implement.
     220}
     221
     222void TestRunner::removeAllWebNotificationPermissions()
     223{
     224    // FIXME: implement.
     225}
     226
     227void TestRunner::simulateWebNotificationClick(const QWebElement& notification)
     228{
     229    // FIXME: implement.
     230}
     231
     232void TestRunner::simulateLegacyWebNotificationClick(const QString& title)
    223233{
    224234    DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title);
  • trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h

    r125603 r126909  
    135135    void setCloseRemainingWindowsWhenComplete(bool = false) { }
    136136    int windowCount();
    137     void grantDesktopNotificationPermission(const QString& origin);
    138     void ignoreDesktopNotificationPermissionRequests();
    139     bool checkDesktopNotificationPermission(const QString& origin);
    140     void simulateDesktopNotificationClick(const QString& title);
     137    void ignoreLegacyWebNotificationPermissionRequests();
     138    void simulateLegacyWebNotificationClick(const QString& title);
     139    void grantWebNotificationPermission(const QString& origin);
     140    void denyWebNotificationPermission(const QString& origin);
     141    void removeAllWebNotificationPermissions();
     142    void simulateWebNotificationClick(const QWebElement&);
    141143    void display();
    142144    void displayInvalidatedRegion();
  • trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp

    r126837 r126909  
    14351435}
    14361436
    1437 void TestRunner::simulateDesktopNotificationClick(JSStringRef title)
     1437void TestRunner::grantWebNotificationPermission(JSStringRef origin)
     1438{
     1439}
     1440
     1441void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin)
     1442{
     1443}
     1444
     1445void TestRunner::removeAllWebNotificationPermissions()
     1446{
     1447}
     1448
     1449void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification)
     1450{
     1451}
     1452
     1453void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title)
    14381454{
    14391455    // FIXME: Implement.
Note: See TracChangeset for help on using the changeset viewer.