Title: [258613] trunk
Revision
258613
Author
[email protected]
Date
2020-03-17 17:12:47 -0700 (Tue, 17 Mar 2020)

Log Message

REGRESSION: [ macOS wk1 ] ASSERTION FAILED: _notifications.contains(notificationID) imported/w3c/web-platform-tests/notifications/constructor-basic.html is flaky crashing
https://bugs.webkit.org/show_bug.cgi?id=207307
<rdar://problem/59206964>

Reviewed by Alex Christensen.

Source/WebKitLegacy/mac:

* WebView/WebNotification.h:
* WebView/WebNotification.mm:
(-[WebNotification finalize]):

Tools:

When [MockWebNotificationProvider reset] was called at the end of the test, it would remove all
notifications from the map but not tell WebCore that the notification were discarded. As a result,
WebCore would later tell the MockWebNotificationProvider to cancel the notification but this
notification would no longer be in the map, causing us to hit an assertion in debug.

To address the issue, we now call Notification::finalize() in [MockWebNotificationProvider reset]
to let WebCore know the notification was discarded. This is similar to what is already done for
WebKit2 in WebNotificationManager::clearNotifications().

* DumpRenderTree/mac/MockWebNotificationProvider.mm:
(-[MockWebNotificationProvider reset]):

LayoutTests:

Add test coverage.

* http/wpt/notifications/constructor-basic-bfcache-expected.txt: Added.
* http/wpt/notifications/constructor-basic-bfcache.html: Added.
* platform/mac/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (258612 => 258613)


--- trunk/LayoutTests/ChangeLog	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/LayoutTests/ChangeLog	2020-03-18 00:12:47 UTC (rev 258613)
@@ -1,3 +1,17 @@
+2020-03-17  Chris Dumez  <[email protected]>
+
+        REGRESSION: [ macOS wk1 ] ASSERTION FAILED: _notifications.contains(notificationID) imported/w3c/web-platform-tests/notifications/constructor-basic.html is flaky crashing
+        https://bugs.webkit.org/show_bug.cgi?id=207307
+        <rdar://problem/59206964>
+
+        Reviewed by Alex Christensen.
+
+        Add test coverage.
+
+        * http/wpt/notifications/constructor-basic-bfcache-expected.txt: Added.
+        * http/wpt/notifications/constructor-basic-bfcache.html: Added.
+        * platform/mac/TestExpectations:
+
 2020-03-17  Chris Fleizach  <[email protected]>
 
         AX: WebKit crashes with VO and keyboard support fails on encapsulated radio button components.

Added: trunk/LayoutTests/http/wpt/notifications/constructor-basic-bfcache-expected.txt (0 => 258613)


--- trunk/LayoutTests/http/wpt/notifications/constructor-basic-bfcache-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/notifications/constructor-basic-bfcache-expected.txt	2020-03-18 00:12:47 UTC (rev 258613)
@@ -0,0 +1,3 @@
+
+PASS Called the notification constructor with one argument. 
+

Added: trunk/LayoutTests/http/wpt/notifications/constructor-basic-bfcache.html (0 => 258613)


--- trunk/LayoutTests/http/wpt/notifications/constructor-basic-bfcache.html	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/notifications/constructor-basic-bfcache.html	2020-03-18 00:12:47 UTC (rev 258613)
@@ -0,0 +1,22 @@
+<!-- webkit-test-runner [ enableBackForwardCache=true ] -->
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Notification constructor (basic)</title>
+<link rel="author" title="Intel" href=""
+<link rel="author" title="Xin Liu" href=""
+<script src=""
+<script src=""
+<script>
+test(function() {
+    if (Notification.permission != "granted") {
+        this.force_timeout()
+        this.set_status(this.NOTRUN, "You must allow notifications for this"
+            + " origin before running this test.")
+    }
+    var notification = new Notification("New Email Received")
+    assert_true(notification instanceof Notification)
+    notification._onshow_ = function() {
+        notification.close()
+    }
+}, "Called the notification constructor with one argument.")
+</script>

Modified: trunk/LayoutTests/platform/mac/TestExpectations (258612 => 258613)


--- trunk/LayoutTests/platform/mac/TestExpectations	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2020-03-18 00:12:47 UTC (rev 258613)
@@ -1963,8 +1963,6 @@
 
 webkit.org/b/207333 imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html [ Pass Failure ]
 
-webkit.org/b/207307 imported/w3c/web-platform-tests/notifications/constructor-basic.html [ Pass Crash ]
-
 webkit.org/b/112939 fast/performance/performance-now-timestamps.html [ Pass Failure ]
 
 webkit.org/b/207363 inspector/css/pseudo-creation.html [ Pass Failure ]
@@ -2042,4 +2040,4 @@
 
 webkit.org/b/209084 css3/selectors3/xml/css3-modsel-d4.xml [ Pass Failure ]
 
-webkit.org/b/207150 platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html [ Pass Failure ]
\ No newline at end of file
+webkit.org/b/207150 platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html [ Pass Failure ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (258612 => 258613)


--- trunk/LayoutTests/platform/win/TestExpectations	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/LayoutTests/platform/win/TestExpectations	2020-03-18 00:12:47 UTC (rev 258613)
@@ -197,6 +197,7 @@
 
 # TODO This port doesn't support Notifications.
 http/tests/notifications/ [ Skip ]
+http/wpt/notifications/ [ Skip ]
 fast/history/page-cache-notification-showing.html [ Skip ]
 fast/history/page-cache-notification-suspendable.html [ Skip ]
 

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (258612 => 258613)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-03-18 00:12:47 UTC (rev 258613)
@@ -1,3 +1,15 @@
+2020-03-17  Chris Dumez  <[email protected]>
+
+        REGRESSION: [ macOS wk1 ] ASSERTION FAILED: _notifications.contains(notificationID) imported/w3c/web-platform-tests/notifications/constructor-basic.html is flaky crashing
+        https://bugs.webkit.org/show_bug.cgi?id=207307
+        <rdar://problem/59206964>
+
+        Reviewed by Alex Christensen.
+
+        * WebView/WebNotification.h:
+        * WebView/WebNotification.mm:
+        (-[WebNotification finalize]):
+
 2020-03-17  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r258339.

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebNotification.h (258612 => 258613)


--- trunk/Source/WebKitLegacy/mac/WebView/WebNotification.h	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebNotification.h	2020-03-18 00:12:47 UTC (rev 258613)
@@ -50,5 +50,6 @@
 - (void)dispatchCloseEvent;
 - (void)dispatchClickEvent;
 - (void)dispatchErrorEvent;
+- (void)finalize;
 
 @end

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebNotification.mm (258612 => 258613)


--- trunk/Source/WebKitLegacy/mac/WebView/WebNotification.mm	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebNotification.mm	2020-03-18 00:12:47 UTC (rev 258613)
@@ -193,5 +193,12 @@
 #endif
 }
 
+- (void)finalize
+{
+#if ENABLE(NOTIFICATIONS)
+    core(self)->finalize();
+#endif
+}
+
 @end
 

Modified: trunk/Tools/ChangeLog (258612 => 258613)


--- trunk/Tools/ChangeLog	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/Tools/ChangeLog	2020-03-18 00:12:47 UTC (rev 258613)
@@ -1,3 +1,23 @@
+2020-03-17  Chris Dumez  <[email protected]>
+
+        REGRESSION: [ macOS wk1 ] ASSERTION FAILED: _notifications.contains(notificationID) imported/w3c/web-platform-tests/notifications/constructor-basic.html is flaky crashing
+        https://bugs.webkit.org/show_bug.cgi?id=207307
+        <rdar://problem/59206964>
+
+        Reviewed by Alex Christensen.
+
+        When [MockWebNotificationProvider reset] was called at the end of the test, it would remove all
+        notifications from the map but not tell WebCore that the notification were discarded. As a result,
+        WebCore would later tell the MockWebNotificationProvider to cancel the notification but this
+        notification would no longer be in the map, causing us to hit an assertion in debug.
+
+        To address the issue, we now call Notification::finalize() in [MockWebNotificationProvider reset]
+        to let WebCore know the notification was discarded. This is similar to what is already done for
+        WebKit2 in WebNotificationManager::clearNotifications().
+
+        * DumpRenderTree/mac/MockWebNotificationProvider.mm:
+        (-[MockWebNotificationProvider reset]):
+
 2020-03-17  Don Olmstead  <[email protected]>
 
         [WinCairo][FTW] Update path to requirements download

Modified: trunk/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm (258612 => 258613)


--- trunk/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm	2020-03-18 00:06:14 UTC (rev 258612)
+++ trunk/Tools/DumpRenderTree/mac/MockWebNotificationProvider.mm	2020-03-18 00:12:47 UTC (rev 258613)
@@ -143,7 +143,10 @@
 
 - (void)reset
 {
-    _notifications.clear();
+    auto notifications = WTFMove(_notifications);
+    for (auto notification : notifications.values())
+        [notification finalize];
+
     _notificationViewMap.clear();
     [self removeAllWebNotificationPermissions];
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to