class CompositeTest
Defined at line 428 of file ../../src/media/audio/services/device_registry/device_unittest.h
Protected Members
static basic_string kClassName
Protected Methods
const std::vector<std::pair<ElementId, std::vector<fuchsia_hardware_audio::SupportedFormats2>>> & ElementDriverRingBufferFormatSets (const std::shared_ptr<Device> & device)
Defined at line 431 of file ../../src/media/audio/services/device_registry/device_unittest.h
const std::vector<std::pair<ElementId, std::vector<fuchsia_hardware_audio::SupportedFormats2>>> & ElementDriverPacketStreamFormatSets (const std::shared_ptr<Device> & device)
Defined at line 437 of file ../../src/media/audio/services/device_registry/device_unittest.h
const std::unordered_map<ElementId, ElementRecord> & signal_processing_elements (const std::shared_ptr<Device> & device)
Defined at line 443 of file ../../src/media/audio/services/device_registry/device_unittest.h
std::shared_ptr<FakeComposite> MakeFakeComposite ()
Defined at line 448 of file ../../src/media/audio/services/device_registry/device_unittest.h
std::shared_ptr<Device> InitializeDeviceForFakeComposite (const std::shared_ptr<FakeComposite> & driver)
Defined at line 457 of file ../../src/media/audio/services/device_registry/device_unittest.h
bool ExpectDaiFormatMatches (ElementId dai_id, const fuchsia_hardware_audio::DaiFormat & dai_format)
Defined at line 482 of file ../../src/media/audio/services/device_registry/device_unittest.h
bool ExpectDaiFormatError (ElementId element_id, fuchsia_audio_device::ControlSetDaiFormatError expected_error)
Defined at line 500 of file ../../src/media/audio/services/device_registry/device_unittest.h
void TestCreateRingBuffer (const std::shared_ptr<Device> &device,ElementIdelement_id,const fuchsia_hardware_audio::Format2 &safe_format)
RingBuffer test cases
Creating a RingBuffer should succeed.
Defined at line 1343 of file ../../src/media/audio/services/device_registry/device_unittest.cc
void TestCreatePacketStream (const std::shared_ptr<Device> &device,ElementIdelement_id,const fuchsia_hardware_audio::Format2 &safe_format)
Defined at line 1781 of file ../../src/media/audio/services/device_registry/device_unittest.cc
void TestAllocatePacketStreamBuffers (const std::shared_ptr<Device> & device, ElementId element_id)
PacketStream Buffer Configuration Expectations based on Driver Capabilities:
1. Driver supports CLIENT_OWNED, DRIVER_OWNED, INLINE
- SetBuffers(Allocate) -> Success. Start() -> Success. PutPacket(VMO/INLINE) -> Success.
- SetBuffers(Register) -> Success. Start() -> Success. PutPacket(VMO/INLINE) -> Success.
- No SetBuffers -> Start() succeeds. PutPacket(VMO) -> ZX_ERR_BAD_STATE. PutPacket(INLINE) ->
Success.
2. Driver supports CLIENT_OWNED, DRIVER_OWNED
- SetBuffers(Allocate) -> Success. Start() -> Success. PutPacket(INLINE) ->
ZX_ERR_INVALID_ARGS.
- SetBuffers(Register) -> Success. Start() -> Success. PutPacket(INLINE) ->
ZX_ERR_INVALID_ARGS.
- No SetBuffers -> Start() fails with ZX_ERR_BAD_STATE.
3. Driver supports CLIENT_OWNED, INLINE
- SetBuffers(Allocate) -> Fails with ZX_ERR_INVALID_ARGS.
- SetBuffers(Register) -> Success. Start() -> Success. PutPacket(VMO/INLINE) -> Success.
- No SetBuffers -> Start() succeeds. PutPacket(VMO) -> ZX_ERR_BAD_STATE. PutPacket(INLINE) ->
Success.
4. Driver supports DRIVER_OWNED, INLINE
- SetBuffers(Allocate) -> Success. Start() -> Success. PutPacket(VMO/INLINE) -> Success.
- SetBuffers(Register) -> Fails with ZX_ERR_INVALID_ARGS.
- No SetBuffers -> Start() succeeds. PutPacket(VMO) -> ZX_ERR_BAD_STATE. PutPacket(INLINE) ->
Success.
5. Driver supports CLIENT_OWNED only
- SetBuffers(Allocate) -> Fails with ZX_ERR_INVALID_ARGS.
- SetBuffers(Register) -> Success. Start() -> Success. PutPacket(INLINE) ->
ZX_ERR_INVALID_ARGS.
- No SetBuffers -> Start() fails with ZX_ERR_BAD_STATE.
6. Driver supports DRIVER_OWNED only
- SetBuffers(Allocate) -> Success. Start() -> Success. PutPacket(INLINE) ->
ZX_ERR_INVALID_ARGS.
- SetBuffers(Register) -> Fails with ZX_ERR_INVALID_ARGS.
- No SetBuffers -> Start() fails with ZX_ERR_BAD_STATE.
7. Driver supports INLINE only
- SetBuffers(Allocate/Register) -> Fails with ZX_ERR_INVALID_ARGS.
- No SetBuffers -> Start() succeeds. PutPacket(VMO) -> ZX_ERR_INVALID_ARGS. PutPacket(INLINE)
-> Success.
8. Driver supports [NO bits set]
- ADR should fail to initialize and add the device.
Defined at line 1850 of file ../../src/media/audio/services/device_registry/device_unittest.cc
void TestRegisterPacketStreamBuffers (const std::shared_ptr<Device> & device, ElementId element_id)
Defined at line 1871 of file ../../src/media/audio/services/device_registry/device_unittest.cc