haikuwebkit/LayoutTests/fast/mediacapturefromelement
Geoffrey Garen 3743eb9588 [Mac] LayoutTest fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=175592

Reviewed by Eric Carlson.

Source/WebCore:

* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h: Renamed
m_canvasChangedTimer to m_captureCanvasTimer because the timer invokes
captureCanvas() when it fires.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
Removed m_pendingSelectedTrackCheck because track update is sync now.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
Invoke checkSelectedVideoTrack() and updateTracks() synchronously.
Otherwise, we can miss the first frame rendered to our track.
(Technically, there was no upper bound on the number of frames we might
miss; but in practice, we tended to miss just the first one.)

LayoutTests:

There were two bugs here: (1) This test was flaky; (2) WebKit's canvas
capture implementation was flaky. Debugging them together was a lot of
fun!

* fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events-expected.txt:
Reflect the fact that the test draws earlier now.

* fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html:

Fixed (1): Define our WebGL shader before running the script that
references it. Otherwise, we might try to run the shader before the
HTML parser has parsed it.

Improved detection of (2): Draw to the canvas immediately instead of
waiting for an async event. This should more precisely test whether
the very first canvas frame gets captured or not.

* platform/mac/TestExpectations: Unmark test as flaky.


Canonical link: https://commits.webkit.org/231798@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-20 01:03:43 +00:00
..
resources Remove all remaining boolean overridePreference calls 2020-10-30 01:17:30 +00:00
CanvasCaptureMediaStream-2d-events-expected.txt
CanvasCaptureMediaStream-2d-events.html
CanvasCaptureMediaStream-capture-out-of-DOM-element-expected.txt
CanvasCaptureMediaStream-capture-out-of-DOM-element.html
CanvasCaptureMediaStream-clone-track-expected.txt
CanvasCaptureMediaStream-clone-track.html
CanvasCaptureMediaStream-creation-expected.txt
CanvasCaptureMediaStream-creation.html
CanvasCaptureMediaStream-exceptions-expected.txt
CanvasCaptureMediaStream-exceptions.html
CanvasCaptureMediaStream-framerate-0-expected.txt
CanvasCaptureMediaStream-framerate-0.html
CanvasCaptureMediaStream-imagebitmaprenderingcontext-expected.txt
CanvasCaptureMediaStream-imagebitmaprenderingcontext.html
CanvasCaptureMediaStream-offscreencanvas-expected.txt
CanvasCaptureMediaStream-offscreencanvas.html
CanvasCaptureMediaStream-request-frame-events-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
CanvasCaptureMediaStream-request-frame-events.html
CanvasCaptureMediaStream-webgl-events-expected.txt [Mac] LayoutTest fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html is a flaky timeout 2020-11-20 01:03:43 +00:00
CanvasCaptureMediaStream-webgl-events.html [Mac] LayoutTest fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html is a flaky timeout 2020-11-20 01:03:43 +00:00