Title: [269271] trunk
Revision
269271
Author
[email protected]
Date
2020-11-02 13:21:43 -0800 (Mon, 02 Nov 2020)

Log Message

[ macOS ] webaudio/OfflineAudioContext/onstatechange.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=217543
<rdar://problem/70160122>

Reviewed by Alex Christensen.

Source/WebCore:

No new tests, unskipped existing test.

* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):
After offline rendering on the audio thread and we go back to the main thread, make sure we queue a task of the
event loop to fire the statechange and completion events. We were previously failing to do so and that meant
that the ordering with other main thread events (which were queued on the event loop) was not always correct.

LayoutTests:

* platform/mac/TestExpectations:
Unskip test that should no longer be flaky.

* webaudio/OfflineAudioContext/onstatechange-expected.txt:
Rebaseline test now that the order of the promise resolution and the statechange event have changed.
Note that the new ordering is consistent with both Chrome and Firefox.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (269270 => 269271)


--- trunk/LayoutTests/ChangeLog	2020-11-02 21:17:14 UTC (rev 269270)
+++ trunk/LayoutTests/ChangeLog	2020-11-02 21:21:43 UTC (rev 269271)
@@ -1,3 +1,18 @@
+2020-11-02  Chris Dumez  <[email protected]>
+
+        [ macOS ] webaudio/OfflineAudioContext/onstatechange.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=217543
+        <rdar://problem/70160122>
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac/TestExpectations:
+        Unskip test that should no longer be flaky.
+
+        * webaudio/OfflineAudioContext/onstatechange-expected.txt:
+        Rebaseline test now that the order of the promise resolution and the statechange event have changed.
+        Note that the new ordering is consistent with both Chrome and Firefox.
+
 2020-11-02  Diego Pino Garcia  <[email protected]>
 
         [WPE] Unreviewed test gardening. Remove outdated baselines no longer necessary after r269104.

Modified: trunk/LayoutTests/platform/mac/TestExpectations (269270 => 269271)


--- trunk/LayoutTests/platform/mac/TestExpectations	2020-11-02 21:17:14 UTC (rev 269270)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2020-11-02 21:21:43 UTC (rev 269271)
@@ -2240,8 +2240,6 @@
 
 webkit.org/b/217542 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/processing-after-resume.https.html [ Pass Failure ]
 
-webkit.org/b/217543 webaudio/OfflineAudioContext/onstatechange.html [ Pass Failure ]
-
 webkit.org/b/209073 [ Debug ] inspector/injected-script/avoid-getter-invocation.html [ Pass Timeout ]
 
 webkit.org/b/217641 [ Debug ] imported/w3c/web-platform-tests/xhr/event-timeout.any.worker.html [ Pass Failure ]

Modified: trunk/LayoutTests/webaudio/OfflineAudioContext/onstatechange-expected.txt (269270 => 269271)


--- trunk/LayoutTests/webaudio/OfflineAudioContext/onstatechange-expected.txt	2020-11-02 21:17:14 UTC (rev 269270)
+++ trunk/LayoutTests/webaudio/OfflineAudioContext/onstatechange-expected.txt	2020-11-02 21:21:43 UTC (rev 269271)
@@ -4,8 +4,8 @@
 PASS Audit report
 PASS > [test] Signaling of statechange event
 PASS   context.state is equal to running.
+PASS   Context rendering resolved correctly.
 PASS   context.state is equal to closed.
-PASS   Context rendering resolved correctly.
 PASS   stateChangeCount is equal to 2.
 PASS   After rendering context.state is equal to closed.
 PASS < [test] All assertions passed. (total 5 assertions)

Modified: trunk/Source/WebCore/ChangeLog (269270 => 269271)


--- trunk/Source/WebCore/ChangeLog	2020-11-02 21:17:14 UTC (rev 269270)
+++ trunk/Source/WebCore/ChangeLog	2020-11-02 21:21:43 UTC (rev 269271)
@@ -1,3 +1,19 @@
+2020-11-02  Chris Dumez  <[email protected]>
+
+        [ macOS ] webaudio/OfflineAudioContext/onstatechange.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=217543
+        <rdar://problem/70160122>
+
+        Reviewed by Alex Christensen.
+
+        No new tests, unskipped existing test.
+
+        * Modules/webaudio/OfflineAudioDestinationNode.cpp:
+        (WebCore::OfflineAudioDestinationNode::startRendering):
+        After offline rendering on the audio thread and we go back to the main thread, make sure we queue a task of the
+        event loop to fire the statechange and completion events. We were previously failing to do so and that meant
+        that the ordering with other main thread events (which were queued on the event loop) was not always correct.
+
 2020-11-01  Darin Adler  <[email protected]>
 
         Start removing functions that implicitly use composed tree

Modified: trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp (269270 => 269271)


--- trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp	2020-11-02 21:17:14 UTC (rev 269270)
+++ trunk/Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp	2020-11-02 21:21:43 UTC (rev 269271)
@@ -101,19 +101,21 @@
 
     auto offThreadRendering = [this, protectedThis = WTFMove(protectedThis)]() mutable {
         auto result = offlineRender();
-        callOnMainThread([this, result, currentSampleFrame = m_currentSampleFrame, protectedThis = WTFMove(protectedThis)] {
-            m_startedRendering = false;
-            switch (result) {
-            case OfflineRenderResult::Failure:
-                context().finishedRendering(false);
-                break;
-            case OfflineRenderResult::Complete:
-                context().finishedRendering(true);
-                break;
-            case OfflineRenderResult::Suspended:
-                context().didSuspendRendering(currentSampleFrame);
-                break;
-            }
+        callOnMainThread([this, result, currentSampleFrame = m_currentSampleFrame, protectedThis = WTFMove(protectedThis)]() mutable {
+            context().postTask([this, protectedThis = WTFMove(protectedThis), result, currentSampleFrame]() mutable {
+                m_startedRendering = false;
+                switch (result) {
+                case OfflineRenderResult::Failure:
+                    context().finishedRendering(false);
+                    break;
+                case OfflineRenderResult::Complete:
+                    context().finishedRendering(true);
+                    break;
+                case OfflineRenderResult::Suspended:
+                    context().didSuspendRendering(currentSampleFrame);
+                    break;
+                }
+            });
         });
     };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to