mozilla / cubeb-coreaudio-rs

The audio backend of Firefox on Mac OS X.
ISC License
25 stars 10 forks source link

Rework `test_unplug_a_device_on_an_active_stream` #127

Closed ChunMinChang closed 3 years ago

ChunMinChang commented 3 years ago

When we create/add/plug a new device to Mac OS, the newly added device is possible to be the new default device (depends on system setting?). In test_unplug_a_device_on_an_active_stream, we didn't check if the default device is the expected one. The created device in that function could be the default device in some tests, and it could be non-default device in some tests. We need to check if the created device is default or non-default before running the tests. Otherwise we may use the wrong device to run the tests.

ChunMinChang commented 3 years ago

This is caught by running github-action: https://github.com/ChunMinChang/cubeb-coreaudio-rs/runs/2069461472?check_suite_focus=true#step:5:586