Changeset 126909 in webkit
- Timestamp:
- Aug 28, 2012, 12:08:32 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 36 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-check-permission.html (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-click-event-focus.html (modified) (2 diffs)
-
LayoutTests/fast/notifications/notifications-click-event.html (modified) (2 diffs)
-
LayoutTests/fast/notifications/notifications-display-close-events.html (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-document-close-crash.html (modified) (3 diffs)
-
LayoutTests/fast/notifications/notifications-double-show.html (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-event-stop-propagation.html-disabled (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-multi-events.html-disabled (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-no-icon.html (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-replace.html (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-rtl.html (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-with-permission.html (modified) (1 diff)
-
LayoutTests/fast/notifications/notifications-without-permission.html (modified) (1 diff)
-
LayoutTests/fast/notifications/resources/notifications-cancel-request-permission.html (modified) (1 diff)
-
LayoutTests/platform/qt-5.0-wk2/Skipped (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/WebCore.exp.in (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (2 diffs)
-
Source/WebKit/mac/ChangeLog (modified) (1 diff)
-
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h (modified) (1 diff)
-
Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm (modified) (1 diff)
-
Source/WebKit/mac/WebView/WebView.mm (modified) (2 diffs)
-
Source/WebKit/mac/WebView/WebViewPrivate.h (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/DumpRenderTree/TestRunner.cpp (modified) (8 diffs)
-
Tools/DumpRenderTree/TestRunner.h (modified) (3 diffs)
-
Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp (modified) (1 diff)
-
Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (modified) (4 diffs)
-
Tools/DumpRenderTree/chromium/DRTTestRunner.h (modified) (1 diff)
-
Tools/DumpRenderTree/efl/TestRunnerEfl.cpp (modified) (1 diff)
-
Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp (modified) (1 diff)
-
Tools/DumpRenderTree/mac/TestRunnerMac.mm (modified) (1 diff)
-
Tools/DumpRenderTree/qt/TestRunnerQt.cpp (modified) (2 diffs)
-
Tools/DumpRenderTree/qt/TestRunnerQt.h (modified) (1 diff)
-
Tools/DumpRenderTree/win/TestRunnerWin.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r126908 r126909 1 2012-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 1 29 2012-08-28 Dominic Mazzoni <dmazzoni@google.com> 2 30 -
trunk/LayoutTests/fast/notifications/notifications-check-permission.html
r124410 r126909 26 26 27 27 if (window.testRunner) { 28 testRunner.grant DesktopNotificationPermission("file://");28 testRunner.grantWebNotificationPermission("file://"); 29 29 } 30 30 -
trunk/LayoutTests/fast/notifications/notifications-click-event-focus.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 testRunner.waitUntilDone(); … … 33 33 34 34 if (window.testRunner) { 35 testRunner.simulate DesktopNotificationClick("New E-mail");35 testRunner.simulateLegacyWebNotificationClick("New E-mail"); 36 36 testRunner.notifyDone(); 37 37 } -
trunk/LayoutTests/fast/notifications/notifications-click-event.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 testRunner.waitUntilDone(); … … 24 24 N.show(); 25 25 if (window.testRunner) { 26 testRunner.simulate DesktopNotificationClick("New E-mail");26 testRunner.simulateLegacyWebNotificationClick("New E-mail"); 27 27 testRunner.notifyDone(); 28 28 } -
trunk/LayoutTests/fast/notifications/notifications-display-close-events.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 testRunner.waitUntilDone(); -
trunk/LayoutTests/fast/notifications/notifications-document-close-crash.html
r124410 r126909 7 7 testRunner.dumpAsText(); 8 8 testRunner.setCanOpenWindows(); 9 testRunner.grant DesktopNotificationPermission("file://");9 testRunner.grantWebNotificationPermission("file://"); 10 10 testRunner.waitUntilDone(); 11 11 } 12 12 13 13 if (!window.webkitNotifications) { 14 14 log("FAIL: No webkitNotifications interface!"); … … 29 29 { 30 30 a.push(new WebGLByteArray()); 31 } 31 } 32 32 catch (e) {} 33 33 a.push(Array(i).join("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); … … 36 36 notification.requestPermission(); 37 37 } 38 38 39 39 function finish() 40 40 { -
trunk/LayoutTests/fast/notifications/notifications-double-show.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 testRunner.waitUntilDone(); -
trunk/LayoutTests/fast/notifications/notifications-event-stop-propagation.html-disabled
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 } -
trunk/LayoutTests/fast/notifications/notifications-multi-events.html-disabled
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 } -
trunk/LayoutTests/fast/notifications/notifications-no-icon.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 } -
trunk/LayoutTests/fast/notifications/notifications-replace.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 } -
trunk/LayoutTests/fast/notifications/notifications-rtl.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 } -
trunk/LayoutTests/fast/notifications/notifications-with-permission.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 testRunner.grant DesktopNotificationPermission("file://");13 testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 testRunner.waitUntilDone(); -
trunk/LayoutTests/fast/notifications/notifications-without-permission.html
r124410 r126909 11 11 { 12 12 if (window.testRunner) { 13 // NO PERMISSION testRunner.grant DesktopNotificationPermission("file://");13 // NO PERMISSION testRunner.grantWebNotificationPermission("file://"); 14 14 testRunner.dumpAsText(); 15 15 } -
trunk/LayoutTests/fast/notifications/resources/notifications-cancel-request-permission.html
r124410 r126909 14 14 15 15 if (window.testRunner) { 16 testRunner.ignore DesktopNotificationPermissionRequests();16 testRunner.ignoreLegacyWebNotificationPermissionRequests(); 17 17 } 18 18 -
trunk/LayoutTests/platform/qt-5.0-wk2/Skipped
r126751 r126909 142 142 http/tests/websocket/tests/hixie76/bad-sub-protocol-non-ascii.html 143 143 144 # layoutTestController.ignore DesktopNotificationPermissionRequests is unimplemented144 # layoutTestController.ignoreLegacyWebNotificationPermissionRequests is unimplemented 145 145 fast/notifications 146 146 -
trunk/Source/WebCore/ChangeLog
r126908 r126909 1 2012-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 1 16 2012-08-28 Dominic Mazzoni <dmazzoni@google.com> 2 17 -
trunk/Source/WebCore/WebCore.exp.in
r126444 r126909 2324 2324 __ZN7WebCore12Notification18dispatchCloseEventEv 2325 2325 __ZN7WebCore12Notification18dispatchErrorEventEv 2326 __ZN7WebCore14toNotificationEN3JSC7JSValueE 2326 2327 __ZN7WebCore19provideNotificationEPNS_4PageEPNS_18NotificationClientE 2328 __ZN7WebCore22NotificationController10clientFromEPNS_4PageE 2327 2329 #endif 2328 2330 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r126857 r126909 870 870 31288E750E3005D6003619AE /* WebKitCSSKeyframesRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 31288E710E3005D6003619AE /* WebKitCSSKeyframesRule.h */; }; 871 871 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, ); }; }; 873 873 312C0C41146DC6CC0016C911 /* Notification.h in Headers */ = {isa = PBXBuildFile; fileRef = 333F704F0FB49CA2008E12A6 /* Notification.h */; settings = {ATTRIBUTES = (Private, ); }; }; 874 874 312D67B11535691F00563D0D /* Dictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 312D67B01535691F00563D0D /* Dictionary.cpp */; }; … … 953 953 33503C9A10179A74003B47E1 /* NotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503C9910179A74003B47E1 /* NotificationClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 954 954 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, ); }; }; 956 956 33503CA510179AD7003B47E1 /* JSNotificationCenter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33503CA110179AD7003B47E1 /* JSNotificationCenter.cpp */; }; 957 957 33503CA610179AD7003B47E1 /* JSNotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 33503CA210179AD7003B47E1 /* JSNotificationCenter.h */; }; -
trunk/Source/WebKit/mac/ChangeLog
r126837 r126909 1 2012-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 1 23 2012-08-27 Sheriff Bot <webkit.review.bot@gmail.com> 2 24 -
trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.h
r115943 r126909 49 49 WebView *webView() { return m_webView; } 50 50 51 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 52 // For testing purposes. 53 uint64_t notificationIDForTesting(WebCore::Notification*); 54 #endif 55 51 56 private: 52 57 virtual bool show(WebCore::Notification*) OVERRIDE; -
trunk/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm
r126837 r126909 231 231 232 232 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) 233 uint64_t WebNotificationClient::notificationIDForTesting(WebCore::Notification* notification) 234 { 235 return [m_notificationMap.get(notification).get() notificationID]; 236 } 237 233 238 @implementation WebNotificationPolicyListener 234 239 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r126343 r126909 144 144 #import <WebCore/JSElement.h> 145 145 #import <WebCore/JSNodeList.h> 146 #import <WebCore/JSNotification.h> 146 147 #import <WebCore/Logging.h> 147 148 #import <WebCore/MemoryPressureHandler.h> 148 149 #import <WebCore/MIMETypeRegistry.h> 149 150 #import <WebCore/NodeList.h> 151 #import <WebCore/Notification.h> 152 #import <WebCore/NotificationController.h> 150 153 #import <WebCore/Page.h> 151 154 #import <WebCore/PageCache.h> … … 6547 6550 [[self _notificationProvider] webView:self didCloseNotifications:notificationIDs]; 6548 6551 } 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 } 6549 6559 @end 6550 6560 -
trunk/Source/WebKit/mac/WebView/WebViewPrivate.h
r123674 r126909 740 740 - (void)_notificationDidClick:(uint64_t)notificationID; 741 741 - (void)_notificationsDidClose:(NSArray *)notificationIDs; 742 743 - (uint64_t)_notificationIDForTesting:(JSValueRef)jsNotification; 742 744 @end 743 745 -
trunk/Tools/ChangeLog
r126905 r126909 1 2012-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 1 48 2012-08-28 Szilard Ledan <szledan@inf.u-szeged.hu> 2 49 -
trunk/Tools/DumpRenderTree/TestRunner.cpp
r125516 r126909 93 93 , m_shouldPaintBrokenImage(true) 94 94 , m_shouldStayOnPageAfterHandlingBeforeUnload(false) 95 , m_are DesktopNotificationPermissionRequestsIgnored(false)95 , m_areLegacyWebNotificationPermissionRequestsIgnored(false) 96 96 , m_customFullScreenBehavior(false) 97 97 , m_testPathOrURL(testPathOrURL) … … 646 646 controller->goBack(); 647 647 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 implementation654 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 661 648 return JSValueMakeUndefined(context); 662 649 } … … 2135 2122 } 2136 2123 2137 static JSValueRef ignore DesktopNotificationPermissionRequestsCallback(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->ignore DesktopNotificationPermissionRequests();2141 return JSValueMakeUndefined(context); 2142 } 2143 2144 static JSValueRef simulate DesktopNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)2124 static 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 2131 static JSValueRef simulateLegacyWebNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 2145 2132 { 2146 2133 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 2147 2134 JSRetainPtr<JSStringRef> title(Adopt, JSValueToStringCopy(context, arguments[0], exception)); 2148 controller->simulate DesktopNotificationClick(title.get());2135 controller->simulateLegacyWebNotificationClick(title.get()); 2149 2136 return JSValueMakeUndefined(context); 2150 2137 } … … 2197 2184 TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); 2198 2185 controller->setStorageDatabaseIdleInterval(interval); 2186 2187 return JSValueMakeUndefined(context); 2188 } 2189 2190 static 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 2205 static 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 2220 static 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 2230 static 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]); 2199 2239 2200 2240 return JSValueMakeUndefined(context); … … 2303 2343 { "originsWithApplicationCache", originsWithApplicationCacheCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2304 2344 { "goBack", goBackCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2305 { "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2306 { "ignoreDesktopNotificationPermissionRequests", ignoreDesktopNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2345 { "ignoreLegacyWebNotificationPermissionRequests", ignoreLegacyWebNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2307 2346 { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2308 2347 { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, … … 2393 2432 { "setAsynchronousSpellCheckingEnabled", setAsynchronousSpellCheckingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2394 2433 { "showWebInspector", showWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2395 { "simulate DesktopNotificationClick", simulateDesktopNotificationClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },2434 { "simulateLegacyWebNotificationClick", simulateLegacyWebNotificationClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2396 2435 { "testOnscreen", testOnscreenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2397 2436 { "testRepaint", testRepaintCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, … … 2418 2457 { "setHasCustomFullScreenBehavior", setHasCustomFullScreenBehaviorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2419 2458 { "setStorageDatabaseIdleInterval", setStorageDatabaseIdleIntervalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2459 { "grantWebNotificationPermission", grantWebNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2460 { "denyWebNotificationPermission", denyWebNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2461 { "removeAllWebNotificationPermissions", removeAllWebNotificationPermissionsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2462 { "simulateWebNotificationClick", simulateWebNotificationClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 2420 2463 { 0, 0, 0 } 2421 2464 }; … … 2459 2502 } 2460 2503 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; 2504 void TestRunner::ignoreLegacyWebNotificationPermissionRequests() 2505 { 2506 m_areLegacyWebNotificationPermissionRequestsIgnored = false; 2481 2507 } 2482 2508 -
trunk/Tools/DumpRenderTree/TestRunner.h
r125516 r126909 137 137 #endif 138 138 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); 144 145 145 146 bool elementDoesAutoCompleteForElementWithId(JSStringRef id); … … 418 419 bool m_shouldPaintBrokenImage; 419 420 bool m_shouldStayOnPageAfterHandlingBeforeUnload; 420 bool m_are DesktopNotificationPermissionRequestsIgnored;421 bool m_areLegacyWebNotificationPermissionRequestsIgnored; 421 422 bool m_customFullScreenBehavior; 422 423 … … 431 432 // base64 encoded WAV audio data is stored here. 432 433 std::string m_encodedAudioData; 433 434 // origins which have been granted desktop notification access435 std::vector<JSStringRef> m_desktopNotificationAllowedOrigins;436 434 437 435 std::map<std::string, std::string> m_URLsToRedirect; -
trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
r125516 r126909 819 819 } 820 820 821 void TestRunner::simulateDesktopNotificationClick(JSStringRef title) 821 void TestRunner::grantWebNotificationPermission(JSStringRef origin) 822 { 823 } 824 825 void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) 826 { 827 } 828 829 void TestRunner::removeAllWebNotificationPermissions() 830 { 831 } 832 833 void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification) 834 { 835 } 836 837 void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title) 822 838 { 823 839 } -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r125516 r126909 156 156 bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors); 157 157 #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); 159 162 #endif 160 163 bindMethod("findString", &DRTTestRunner::findString); … … 234 237 bindMethod("showWebInspector", &DRTTestRunner::showWebInspector); 235 238 #if ENABLE(NOTIFICATIONS) 236 bindMethod("simulate DesktopNotificationClick", &DRTTestRunner::simulateDesktopNotificationClick);239 bindMethod("simulateLegacyWebNotificationClick", &DRTTestRunner::simulateLegacyWebNotificationClick); 237 240 #endif 238 241 bindMethod("startSpeechInput", &DRTTestRunner::startSpeechInput); … … 1179 1182 1180 1183 #if ENABLE(NOTIFICATIONS) 1181 void DRTTestRunner::grant DesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result)1184 void DRTTestRunner::grantWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result) 1182 1185 { 1183 1186 if (arguments.size() != 1 || !arguments[0].isString()) { … … 1191 1194 } 1192 1195 1193 void DRTTestRunner::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result) 1196 void DRTTestRunner::denyWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result) 1197 { 1198 // FIXME: Implement. 1199 result->setNull(); 1200 } 1201 1202 void DRTTestRunner::removeAllWebNotificationPermissions(const CppArgumentList& arguments, CppVariant* result) 1203 { 1204 // FIXME: Implement. 1205 result->setNull(); 1206 } 1207 1208 void DRTTestRunner::simulateWebNotificationClick(const CppArgumentList& arguments, CppVariant* result) 1209 { 1210 // FIXME: Implement. 1211 result->setNull(); 1212 } 1213 1214 void DRTTestRunner::simulateLegacyWebNotificationClick(const CppArgumentList& arguments, CppVariant* result) 1194 1215 { 1195 1216 if (arguments.size() != 1 || !arguments[0].isString()) { -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r125516 r126909 235 235 #if ENABLE(NOTIFICATIONS) 236 236 // 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*); 238 241 // Simulates a click on a desktop notification. 239 void simulate DesktopNotificationClick(const CppArgumentList&, CppVariant*);242 void simulateLegacyWebNotificationClick(const CppArgumentList&, CppVariant*); 240 243 #endif 241 244 -
trunk/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
r125516 r126909 881 881 } 882 882 883 void TestRunner::simulateDesktopNotificationClick(JSStringRef title) 883 void TestRunner::grantWebNotificationPermission(JSStringRef origin) 884 { 885 } 886 887 void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) 888 { 889 } 890 891 void TestRunner::removeAllWebNotificationPermissions() 892 { 893 } 894 895 void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification) 896 { 897 } 898 899 void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title) 884 900 { 885 901 } -
trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp
r125516 r126909 968 968 } 969 969 970 void TestRunner::simulateDesktopNotificationClick(JSStringRef title) 970 void TestRunner::grantWebNotificationPermission(JSStringRef origin) 971 { 972 } 973 974 void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) 975 { 976 } 977 978 void TestRunner::removeAllWebNotificationPermissions() 979 { 980 } 981 982 void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification) 983 { 984 } 985 986 void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title) 971 987 { 972 988 } -
trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm
r125516 r126909 1164 1164 } 1165 1165 1166 void TestRunner::simulateDesktopNotificationClick(JSStringRef title) 1166 void TestRunner::simulateLegacyWebNotificationClick(JSStringRef jsTitle) 1167 { 1168 } 1169 1170 void TestRunner::resetPageVisibility() 1167 1171 { 1168 1172 // FIXME: Implement. 1169 1173 } 1170 1174 1171 void TestRunner:: resetPageVisibility()1175 void TestRunner::setPageVisibility(const char*) 1172 1176 { 1173 1177 // FIXME: Implement. 1174 1178 } 1175 1179 1176 void TestRunner::se tPageVisibility(const char*)1180 void TestRunner::sendWebIntentResponse(JSStringRef) 1177 1181 { 1178 1182 // FIXME: Implement. 1179 1183 } 1180 1184 1181 void TestRunner:: sendWebIntentResponse(JSStringRef)1185 void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) 1182 1186 { 1183 1187 // FIXME: Implement. 1184 1188 } 1185 1189 1186 void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) 1187 { 1188 // FIXME: Implement. 1189 } 1190 1191 void TestRunner::grantWebNotificationPermission(JSStringRef jsOrigin) 1192 { 1193 } 1194 1195 void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) 1196 { 1197 } 1198 1199 void TestRunner::removeAllWebNotificationPermissions() 1200 { 1201 } 1202 1203 void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification) 1204 { 1205 } 1206 -
trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp
r125516 r126909 203 203 } 204 204 205 void TestRunner::grant DesktopNotificationPermission(const QString& origin)205 void TestRunner::grantWebNotificationPermission(const QString& origin) 206 206 { 207 207 QWebFrame* frame = m_drt->webPage()->mainFrame(); … … 210 210 } 211 211 212 void TestRunner::ignore DesktopNotificationPermissionRequests()212 void TestRunner::ignoreLegacyWebNotificationPermissionRequests() 213 213 { 214 214 m_ignoreDesktopNotification = true; 215 215 } 216 216 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) 217 void TestRunner::denyWebNotificationPermission(const QString& origin) 218 { 219 // FIXME: implement. 220 } 221 222 void TestRunner::removeAllWebNotificationPermissions() 223 { 224 // FIXME: implement. 225 } 226 227 void TestRunner::simulateWebNotificationClick(const QWebElement& notification) 228 { 229 // FIXME: implement. 230 } 231 232 void TestRunner::simulateLegacyWebNotificationClick(const QString& title) 223 233 { 224 234 DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title); -
trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h
r125603 r126909 135 135 void setCloseRemainingWindowsWhenComplete(bool = false) { } 136 136 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&); 141 143 void display(); 142 144 void displayInvalidatedRegion(); -
trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp
r126837 r126909 1435 1435 } 1436 1436 1437 void TestRunner::simulateDesktopNotificationClick(JSStringRef title) 1437 void TestRunner::grantWebNotificationPermission(JSStringRef origin) 1438 { 1439 } 1440 1441 void TestRunner::denyWebNotificationPermission(JSStringRef jsOrigin) 1442 { 1443 } 1444 1445 void TestRunner::removeAllWebNotificationPermissions() 1446 { 1447 } 1448 1449 void TestRunner::simulateWebNotificationClick(JSValueRef jsNotification) 1450 { 1451 } 1452 1453 void TestRunner::simulateLegacyWebNotificationClick(JSStringRef title) 1438 1454 { 1439 1455 // FIXME: Implement.
Note:
See TracChangeset
for help on using the changeset viewer.