Title: [277519] trunk
Revision
277519
Author
peng.l...@apple.com
Date
2021-05-14 16:46:10 -0700 (Fri, 14 May 2021)

Log Message

REGRESSION: [ Mac WK2 ] fast/mediastream/audio-track-enabled.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=221985

Reviewed by Eric Carlson.

Source/WebCore:

When `MediaSessionManagerCocoa::updateSessionState()` goes through all sessions, it
counts all WebAudio sessions regardless their states, and it may set the shared audio
session's category to be `AudioSession::AmbientSound` if the count of WebAudio sessions
is not zero.

However, when we close a page with WebAudio, we should not count the WebAudio session
here because the corresponding AudioContext is suspended and will be destroyed soon.
Without this patch, the shared audio session's category might be `AudioSession::AmbientSound`
after we close the WebAudio page.

* Modules/webaudio/AudioContext.h:

LayoutTests:

* platform/mac-wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (277518 => 277519)


--- trunk/LayoutTests/ChangeLog	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/LayoutTests/ChangeLog	2021-05-14 23:46:10 UTC (rev 277519)
@@ -1,3 +1,12 @@
+2021-05-14  Peng Liu  <peng.l...@apple.com>
+
+        REGRESSION: [ Mac WK2 ] fast/mediastream/audio-track-enabled.html is flaky failing
+        https://bugs.webkit.org/show_bug.cgi?id=221985
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac-wk2/TestExpectations:
+
 2021-05-14  Robert Jenner  <jen...@apple.com>
 
         [ iOS14-Simulator ] wk2imported/w3c/web-platform-tests/css/css-will-change/will-change-transform-huge-offset-scrolled.html is a flaky ImageOnlyFailure

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (277518 => 277519)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2021-05-14 23:46:10 UTC (rev 277519)
@@ -1353,8 +1353,6 @@
 webrtc/peerconnection-new-candidate-page-cache.html [ Pass Crash ]
 http/tests/navigation/page-cache-mediastream.html [ Pass Crash ]
 
-webkit.org/b/221985 fast/mediastream/audio-track-enabled.html [ Pass Failure ]
-
 webkit.org/b/224633 media/presentationmodechanged-fired-once.html [ Pass Timeout ]
 
 webkit.org/b/224690 compositing/video/video-border-radius-clipping.html [ Pass ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (277518 => 277519)


--- trunk/Source/WebCore/ChangeLog	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/Source/WebCore/ChangeLog	2021-05-14 23:46:10 UTC (rev 277519)
@@ -1,3 +1,22 @@
+2021-05-14  Peng Liu  <peng.l...@apple.com>
+
+        REGRESSION: [ Mac WK2 ] fast/mediastream/audio-track-enabled.html is flaky failing
+        https://bugs.webkit.org/show_bug.cgi?id=221985
+
+        Reviewed by Eric Carlson.
+
+        When `MediaSessionManagerCocoa::updateSessionState()` goes through all sessions, it
+        counts all WebAudio sessions regardless their states, and it may set the shared audio
+        session's category to be `AudioSession::AmbientSound` if the count of WebAudio sessions
+        is not zero.
+
+        However, when we close a page with WebAudio, we should not count the WebAudio session
+        here because the corresponding AudioContext is suspended and will be destroyed soon.
+        Without this patch, the shared audio session's category might be `AudioSession::AmbientSound`
+        after we close the WebAudio page.
+
+        * Modules/webaudio/AudioContext.h:
+
 2021-05-14  Alan Bujtas  <za...@apple.com>
 
         [showRenderTree] Do not integral floor the overflow values

Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.h (277518 => 277519)


--- trunk/Source/WebCore/Modules/webaudio/AudioContext.h	2021-05-14 23:34:45 UTC (rev 277518)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.h	2021-05-14 23:46:10 UTC (rev 277519)
@@ -111,7 +111,7 @@
     void pageMutedStateDidChange() override;
 
     // PlatformMediaSessionClient
-    PlatformMediaSession::MediaType mediaType() const override { return PlatformMediaSession::MediaType::WebAudio; }
+    PlatformMediaSession::MediaType mediaType() const override { return isSuspended() ? PlatformMediaSession::MediaType::None : PlatformMediaSession::MediaType::WebAudio; }
     PlatformMediaSession::MediaType presentationType() const override { return PlatformMediaSession::MediaType::WebAudio; }
     void mayResumePlayback(bool shouldResume) override;
     void suspendPlayback() override;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to