Closed Bug 1545079 Opened 2 years ago Closed 2 years ago

Create gtest for AudioCallbackDriver::Revive method

Categories

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

66 Branch
task

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: achronop, Assigned: achronop)

References

Details

Attachments

(4 files)

It requires to create a fake cubeb backend and plug it in AudioCallbackDriver. The benefit is that as soon as we have it in place we can use it to test more AudioCallbackDriver methods with gtests.

The bot thinks this bug is a task, but please change it back in case of error.

Type: defect → task

Extract the existing MockCubeb logic from TestAudioDeviceEnumerator to a separate reusable header.

On MochCubeb add a fake audio thread and the corresponding methods for stream_{init,start,stop,destroy}.

IsStarted may not be updated at the time Revive() method is executed since the update of the flag happens on the async operation. This will be the case if Revive is executed right after Start. When that happens the revive method asserts that the stream is started.

Pushed by achronopoulos@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/21607f778c71
Move MockCubeb on a seperate reusable header. r=padenot
https://hg.mozilla.org/integration/autoland/rev/17935ce513d2
Enhance MockCubeb class to simulate a cubeb stream. r=padenot
https://hg.mozilla.org/integration/autoland/rev/70a4ba81a396
Execute revive logic in operation thread. r=padenot
https://hg.mozilla.org/integration/autoland/rev/7e8007308d0d
Create a gtest that exercises revive method of AudioCallbackDriver. r=padenot
Regressions: 1552652
You need to log in before you can comment on or make changes to this bug.