Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION(266293@main): media/audioSession/audioSessionState.html is…
… a flaky failure https://bugs.webkit.org/show_bug.cgi?id=259524 rdar://112914519 Reviewed by Jean-Yves Avenard. The flakiness was due to the following steps: 1. With internals, we simulate beginning an interruption from WebProcess, which is sent to GPU process, which does the interuption business. 2. This triggers notification to the WebProcess that the AudioSession state changed. DOMAudioSession schedules a task to check this and fires an event if needed. 3. Very close to simulating the beginning of the interruption, the WebProcess also tries to activate its audio session. On GPUProcess side, this succeeeds, which triggers ending the interruption. 4. The WebProcess is then notified and DOMAudioSession quickly schedules a task to check this and fires an event as needed. 5. In case the WebProcess beginning and end of interruptions are very close, the first DOMAudioSession task will not see a change of the DOMAudioSession state and will quit early without firing an event. To prevent the flakiness, we enforce RemoteAudioSession::tryToSetActiveInternal to fail when we are in a test interruption and active is true, like would happen in case of a phone call interruption. * LayoutTests/platform/mac/TestExpectations: * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): * Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.cpp: (WebKit::RemoteAudioSession::tryToSetActiveInternal): (WebKit::RemoteAudioSession::endAudioSessionInterruption): (WebKit::RemoteAudioSession::beginInterruptionForTesting): (WebKit::RemoteAudioSession::endInterruptionForTesting): * Source/WebKit/WebProcess/GPU/media/RemoteAudioSession.h: Canonical link: https://commits.webkit.org/267683@main
- Loading branch information