Closed Bug 1691578 Opened 5 years ago Closed 4 years ago

Add test cases to test `DecoderDoctorDiagnostics` and `DecoderDoctorDocumentWatcher`

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: alwu, Assigned: alwu)

References

Details

Attachments

(8 files)

Although we have browser_decoderDoctor.js, that test is only testing the front end part, which starts from sending decoder-doctor-notification notification.

We don't have any test to test the process of (1) setting the error flag on DecoderDoctorDiagnostics (2) processing different error flags (3) determining if the error should be reported to the notification banner or not.

Therefore, in this bug, I will add some test cases to ensure we cover those parts.

MediaPlatformDecoderNotFound sounds too general and seems indicating that this error is platform independent, but that is not true. This error is actually for not founding ffmpeg.

This operation is actually meaningless, because at the time we call CreateRddPDMs(), the PDMFactory is just created. [PDMFactory()->CreatePDMs()->CreateRddPDMs()]

So that is impossible that we've failed to load ffmpeg before, so no need to subtract the FFmpegFailedToLoad flag.

Depends on D104471

Two reasons to have this patch,

(1) we should let caller to be responsible to set the error, like what we do for WMF decoder module. DecoderDoctorDocumentWatcher should simply relys on the flag set in DecoderDoctorDiagnostics.

(2) separating these two different error helps us write a test for different error situation, without relying on the actual state of ffmpeglinker.

Depends on D104472

If some attributes are only able to be set in certain platform, that increase the difficulty of wrting a test.

Therefore, we make them being able to set in all platforms, but doing the check in the fianl stage, which is reporting the result, to ensure that those error would still only be displayed on the right platform.

But if we're in testing, then we can test all error types in one platform.

Depends on D104473

Add test cases for DecoderDoctorDiagnostics::StoreFormatDiagnostics(), which is used when checking the ability of whether the decoder is supported for certain type.

Depends on D104474

I'm still working on this, and will add more test cases.

Attachment #9202136 - Attachment description: Bug 1691578 - part8 : allow showing ffmpeg-no-found notification. → Bug 1691578 - part8 : allow showing platform-decoder-not-found notification.
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6aa662e8d06e part1 : rename `MediaPlatformDecoderNotFound` to `MediaFFMpegNotFound`. r=bryce https://hg.mozilla.org/integration/autoland/rev/71a17ff3322c part2 : remove unnecessary operation of removing ffmpeg error flag. r=bryce https://hg.mozilla.org/integration/autoland/rev/214ab3a2f00b part3 : Set different ffmpeg error in PDMFactory. r=bryce https://hg.mozilla.org/integration/autoland/rev/bfd3e4878545 part4 : allow to set different error in all platforms, but still report them to corresponding platforms, except in testing. r=bryce https://hg.mozilla.org/integration/autoland/rev/23f6dcc3ceb5 part5 : add test cases to test the ability of reporting error for not supported media type. r=bryce,emilio https://hg.mozilla.org/integration/autoland/rev/c181e29b13f2 part6 : add test cases to test reporting decode error. r=bryce,webidl,emilio https://hg.mozilla.org/integration/autoland/rev/518eadda7826 part7 : add test case for audio sink failed start-up. r=bryce,emilio https://hg.mozilla.org/integration/autoland/rev/c535dd429ada part8 : allow showing platform-decoder-not-found notification. r=bryce
Pushed by csabou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6f471ed33aae part1 : rename `MediaPlatformDecoderNotFound` to `MediaFFMpegNotFound`. r=bryce https://hg.mozilla.org/integration/autoland/rev/cdc2e43b78b9 part2 : remove unnecessary operation of removing ffmpeg error flag. r=bryce https://hg.mozilla.org/integration/autoland/rev/739bd8fadc35 part3 : Set different ffmpeg error in PDMFactory. r=bryce https://hg.mozilla.org/integration/autoland/rev/f8a5b58b52cd part4 : allow to set different error in all platforms, but still report them to corresponding platforms, except in testing. r=bryce https://hg.mozilla.org/integration/autoland/rev/d43685e5850b part5 : add test cases to test the ability of reporting error for not supported media type. r=bryce,emilio https://hg.mozilla.org/integration/autoland/rev/a440c4bacde1 part6 : add test cases to test reporting decode error. r=bryce,webidl,emilio https://hg.mozilla.org/integration/autoland/rev/c7afc5693e31 part7 : add test case for audio sink failed start-up. r=bryce,emilio https://hg.mozilla.org/integration/autoland/rev/51161ef5f029 part8 : allow showing platform-decoder-not-found notification. r=bryce
Flags: needinfo?(alwu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: