Changeset 275468 in webkit


Ignore:
Timestamp:
Apr 5, 2021 6:13:53 PM (3 years ago)
Author:
commit-queue@webkit.org
Message:

[ macOS ] media/webaudio-background-playback.html is a flakey text failure
https://bugs.webkit.org/show_bug.cgi?id=221935
<rdar://problem/74370844>

Patch by Philippe Normand <pnormand@igalia.com> on 2021-04-05
Reviewed by Eric Carlson.

The test was flaky because it was checking if the destination had processed new buffers
immediately after an asynchronous state change. The proposed solution is to monitor the
statechange event and do the actual test after another additional 100 milli-seconds have
passed.

  • media/webaudio-background-playback.html:
Location:
trunk/LayoutTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r275466 r275468  
     12021-04-05  Philippe Normand  <pnormand@igalia.com>
     2
     3        [ macOS ] media/webaudio-background-playback.html is a flakey text failure
     4        https://bugs.webkit.org/show_bug.cgi?id=221935
     5        <rdar://problem/74370844>
     6
     7        Reviewed by Eric Carlson.
     8
     9        The test was flaky because it was checking if the destination had processed new buffers
     10        immediately after an asynchronous state change. The proposed solution is to monitor the
     11        statechange event and do the actual test after another additional 100 milli-seconds have
     12        passed.
     13
     14        * media/webaudio-background-playback.html:
     15
    1162021-04-05  Saam Barati  <sbarati@apple.com>
    217
  • trunk/LayoutTests/media/webaudio-background-playback.html

    r271779 r275468  
    8383    assert_true(onProcessCount == oldOnProcessCount, "audio playback suspended in background");
    8484
     85    // Context state changes are asynchronous, so delay the test to until the context has restarted + 100 additional milli-seconds.
     86    context.onstatechange = () => {
     87        setTimeout(() => {
     88             assert_true(onProcessCount > oldOnProcessCount, "audio resumed playing in the foreground");
     89        }, 100);
     90    };
     91
    8592    if (window.internals)
    8693        internals.applicationWillEnterForeground();
    87     oldOnProcessCount = onProcessCount;
    88     await new Promise(resolve => setTimeout(resolve, 100));
    89     assert_true(onProcessCount > oldOnProcessCount, "audio resumed playing in the foreground");
    90 
    9194
    9295}, "Ensure WebAudio stops playing in the background when the 'BackgroundProcessPlaybackRestricted' restriction is set");
Note: See TracChangeset for help on using the changeset viewer.