Bug 163529 - [GTK] Layout test media/video-playback-restriction-play-before-load.html is failing
Summary: [GTK] Layout test media/video-playback-restriction-play-before-load.html is f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-10-16 20:15 PDT by Michael Catanzaro
Modified: 2018-01-15 07:35 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2016-10-16 20:15:49 PDT
Layout test media/video-playback-restriction-play-before-load.html has been failing since it was added in r201841 "With audio user gesture restriction in place, video.src = 'file', video.play() succeeds where it should fail."  Updating expectations accordingly.

--- /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/media/video-playback-restriction-play-before-load-expected.txt
+++ /home/slave/webkitgtk/gtk-linux-64-release-tests/build/layout-test-results/media/video-playback-restriction-play-before-load-actual.txt
@@ -4,6 +4,6 @@
 RUN(internals.setMediaElementRestrictions(video, "RequireUserGestureForAudioRateChange"))
 RUN(video.src = findMediaFile('video', 'content/test'))
 RUN(video.play().then(resolvePromise, rejectPromise))
-Promise correctly rejected.
+Promise incorrectly resolved. FAIL
 END OF TEST
Comment 1 Ms2ger (he/him; ⌚ UTC+1/+2) 2017-08-15 08:27:22 PDT
What appears to happen here is that we call HTMLMediaElement::setReadyState(), and

m_readyState == HAVE_FUTURE_DATA && oldState <= HAVE_CURRENT_DATA && tracksAreReady

is true, as well as potentiallyPlaying(), so we call scheduleNotifyAboutPlaying(). Only later in the function do we call pauseInternal(), which enqueues a call to rejectPendingPlayPromises().

This means that by the time we try to reject the promise, it's already been resolved. The only obviously related platform-specific code is MediaPlayerPrivateGStreamer::hasAudio(), so I don't know how this would work on mac.
Comment 2 Philippe Normand 2018-01-15 07:34:11 PST
Fixed in https://trac.webkit.org/r226948
Comment 3 Radar WebKit Bug Importer 2018-01-15 07:35:28 PST
<rdar://problem/36521997>