Closed Bug 1582407 Opened 5 years ago Closed 5 years ago

MediaRecorder-pause-resume.html fails

Categories

(Core :: Audio/Video: Recording, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

Details

Attachments

(1 file)

It's failing because "pause" comes before "start" in gecko, opposite of the test's expectations.

Spec-wise the timing of "start" seems undeterministic, as it allows the UA to hold the event until actual data has been gathered, whereas "pause" and "resume" are fired directly in a queued task.

This undeterministic timing of "start" also allows for "stop" to occur without any "start" having been fired. This is admittedly a bit weird, and not handled by the spec. We have solved it by firing a fallback-"start" in the same task as "stop".

The spec allows for MediaRecorder.start() to hold the "start" event until it
has collected some actual data. This means "pause" and "resume" events can occur
before "start", on the contrary of this testcase.

This patch avoids this ambiguity by:

  1. Drawing a frame to the canvas so that the track contains some real data.
  2. Wait for "start" before pause()ing, to ensure "start" comes first.

Note that without 1), 2) could wait indefinitely, resulting in a timeout.

Depends on D46468

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/19502 for changes under testing/web-platform/tests
Pushed by pehrsons@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d7ab956c2962
Fix MediaRecorder-pause-resume.html to avoid start() ambiguities. r=jib
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: