Title: [152683] branches/safari-537-branch

Diff

Modified: branches/safari-537-branch/LayoutTests/ChangeLog (152682 => 152683)


--- branches/safari-537-branch/LayoutTests/ChangeLog	2013-07-16 00:18:19 UTC (rev 152682)
+++ branches/safari-537-branch/LayoutTests/ChangeLog	2013-07-16 00:22:28 UTC (rev 152683)
@@ -1,5 +1,25 @@
 2013-07-15  Lucas Forschler  <[email protected]>
 
+        Merge r152642
+
+    2013-07-14  Jon Lee  <[email protected]>
+
+            [WK2] Calling Notification.requestPermission() without a callback crashes
+            https://bugs.webkit.org/show_bug.cgi?id=118654
+            <rdar://problem/14293352>
+
+            Reviewed by Alexey Proskuryakov.
+
+            * http/tests/notifications/notification-request-permission-expected.txt:
+            * http/tests/notifications/notification-request-permission.html: Add additional subtests that check
+            that the call succeeds even after granting or denying permission.
+
+            * http/tests/notifications/notification-request-permission-no-callback-expected.txt: Added.
+            * http/tests/notifications/notification-request-permission-no-callback.html: Added. Similar test to
+            notification-request-permission, without the callback function.
+
+2013-07-15  Lucas Forschler  <[email protected]>
+
         Merge r152580
 
     2013-07-10  Roger Fong  <[email protected]>

Modified: branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-expected.txt (152682 => 152683)


--- branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-expected.txt	2013-07-16 00:18:19 UTC (rev 152682)
+++ branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-expected.txt	2013-07-16 00:22:28 UTC (rev 152683)
@@ -1,4 +1,6 @@
 PASS Notification.requestPermission does not crash.
+PASS Notification.requestPermission does not crash.
+PASS Notification.requestPermission does not crash.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Copied: branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-no-callback-expected.txt (from rev 152642, trunk/LayoutTests/http/tests/notifications/notification-request-permission-no-callback-expected.txt) (0 => 152683)


--- branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-no-callback-expected.txt	                        (rev 0)
+++ branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-no-callback-expected.txt	2013-07-16 00:22:28 UTC (rev 152683)
@@ -0,0 +1,7 @@
+PASS Notification.requestPermission does not crash.
+PASS Notification.requestPermission does not crash.
+PASS Notification.requestPermission does not crash.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-no-callback.html (from rev 152642, trunk/LayoutTests/http/tests/notifications/notification-request-permission-no-callback.html) (0 => 152683)


--- branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-no-callback.html	                        (rev 0)
+++ branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission-no-callback.html	2013-07-16 00:22:28 UTC (rev 152683)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+if (!window.Notification)
+    testFailed("window.Notification does not exist.");
+
+window.Notification.requestPermission();
+testPassed("Notification.requestPermission does not crash.");
+
+testRunner.grantWebNotificationPermission(testURL);
+window.Notification.requestPermission();
+testPassed("Notification.requestPermission does not crash.");
+
+testRunner.denyWebNotificationPermission(testURL);
+window.Notification.requestPermission();
+testPassed("Notification.requestPermission does not crash.");
+</script>
+<script src=""
+</body>
+</html>

Modified: branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission.html (152682 => 152683)


--- branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission.html	2013-07-16 00:18:19 UTC (rev 152682)
+++ branches/safari-537-branch/LayoutTests/http/tests/notifications/notification-request-permission.html	2013-07-16 00:22:28 UTC (rev 152683)
@@ -1,7 +1,8 @@
 <!DOCTYPE html>
 <html>
 <head>
-<script src=""
+<script src=""
+<script src=""
 </head>
 <body>
 <script>
@@ -10,7 +11,15 @@
 
 window.Notification.requestPermission(function() { });
 testPassed("Notification.requestPermission does not crash.");
+
+testRunner.grantWebNotificationPermission(testURL);
+window.Notification.requestPermission(function() { });
+testPassed("Notification.requestPermission does not crash.");
+
+testRunner.denyWebNotificationPermission(testURL);
+window.Notification.requestPermission(function() { });
+testPassed("Notification.requestPermission does not crash.");
 </script>
-<script src=""
+<script src=""
 </body>
 </html>

Modified: branches/safari-537-branch/Source/WebKit/mac/ChangeLog (152682 => 152683)


--- branches/safari-537-branch/Source/WebKit/mac/ChangeLog	2013-07-16 00:18:19 UTC (rev 152682)
+++ branches/safari-537-branch/Source/WebKit/mac/ChangeLog	2013-07-16 00:22:28 UTC (rev 152683)
@@ -1,5 +1,22 @@
 2013-07-15  Lucas Forschler  <[email protected]>
 
+        Merge r152642
+
+    2013-07-14  Jon Lee  <[email protected]>
+
+            [WK2] Calling Notification.requestPermission() without a callback crashes
+            https://bugs.webkit.org/show_bug.cgi?id=118654
+            <rdar://problem/14293352>
+
+            Reviewed by Alexey Proskuryakov.
+
+            * WebCoreSupport/WebNotificationClient.mm:
+            (-[WebNotificationPolicyListener initWithCallback:]): The callback can be NULL, so remove the ASSERT.
+            (-[WebNotificationPolicyListener allow]): Check for the callback before asking it to handle the event.
+            (-[WebNotificationPolicyListener deny]): Ditto.
+
+2013-07-15  Lucas Forschler  <[email protected]>
+
         Merge r152520
 
     2013-07-09  Jeremy Noble  <[email protected]>

Modified: branches/safari-537-branch/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm (152682 => 152683)


--- branches/safari-537-branch/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm	2013-07-16 00:18:19 UTC (rev 152682)
+++ branches/safari-537-branch/Source/WebKit/mac/WebCoreSupport/WebNotificationClient.mm	2013-07-16 00:22:28 UTC (rev 152683)
@@ -241,7 +241,6 @@
     if (!(self = [super init]))
         return nil;
 
-    ASSERT(callback);
     _callback = callback;
     return self;
 }
@@ -269,7 +268,8 @@
     }
 #endif
 #if ENABLE(NOTIFICATIONS)
-    _callback->handleEvent(Notification::permissionString(NotificationClient::PermissionAllowed));
+    if (_callback)
+        _callback->handleEvent(Notification::permissionString(NotificationClient::PermissionAllowed));
 #endif
 }
 
@@ -283,7 +283,8 @@
     }
 #endif
 #if ENABLE(NOTIFICATIONS)
-    _callback->handleEvent(Notification::permissionString(NotificationClient::PermissionDenied));
+    if (_callback)
+        _callback->handleEvent(Notification::permissionString(NotificationClient::PermissionDenied));
 #endif
 }
 

Modified: branches/safari-537-branch/Source/WebKit2/ChangeLog (152682 => 152683)


--- branches/safari-537-branch/Source/WebKit2/ChangeLog	2013-07-16 00:18:19 UTC (rev 152682)
+++ branches/safari-537-branch/Source/WebKit2/ChangeLog	2013-07-16 00:22:28 UTC (rev 152683)
@@ -1,5 +1,24 @@
 2013-07-15  Lucas Forschler  <[email protected]>
 
+        Merge r152642
+
+    2013-07-14  Jon Lee  <[email protected]>
+
+            Calling Notification.requestPermission() without a callback crashes
+            https://bugs.webkit.org/show_bug.cgi?id=118654
+            <rdar://problem/14293352>
+
+            Reviewed by Alexey Proskuryakov.
+
+            When requestPermission() is called, we short-circuit if we know the permission was already set.
+            The callback handler gets invoked. But now that callbacks are optional, we need to check to make
+            sure a callback was provided.
+
+            * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
+            (WebKit::NotificationPermissionRequestManager::startRequest): Check for the callback.
+
+2013-07-15  Lucas Forschler  <[email protected]>
+
         Merge r152580
 
     2013-07-10  Roger Fong  <[email protected]>

Modified: branches/safari-537-branch/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp (152682 => 152683)


--- branches/safari-537-branch/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp	2013-07-16 00:18:19 UTC (rev 152682)
+++ branches/safari-537-branch/Source/WebKit2/WebProcess/Notifications/NotificationPermissionRequestManager.cpp	2013-07-16 00:22:28 UTC (rev 152683)
@@ -70,7 +70,8 @@
 {
     NotificationClient::Permission permission = permissionLevel(origin);
     if (permission != NotificationClient::PermissionNotAllowed) {
-        callback->handleEvent(Notification::permissionString(permission));
+        if (callback)
+            callback->handleEvent(Notification::permissionString(permission));
         return;
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to