class TestBase
Defined at line 109 of file ../../src/media/audio/drivers/tests/test_base.h
TestBase methods are used by both BasicTest and AdminTest cases.
Public Methods
void TestBase (const DeviceEntry & device_entry)
Defined at line 111 of file ../../src/media/audio/drivers/tests/test_base.h
Protected Methods
void SetUp ()
Device discovery is done once at binary open; a fresh FIDL channel is used for each test.
Defined at line 42 of file ../../src/media/audio/drivers/tests/test_base.cc
void TearDown ()
Defined at line 117 of file ../../src/media/audio/drivers/tests/test_base.cc
const DeviceEntry & device_entry ()
Defined at line 129 of file ../../src/media/audio/drivers/tests/test_base.h
DeviceType device_type ()
Defined at line 130 of file ../../src/media/audio/drivers/tests/test_base.h
DriverType driver_type ()
Defined at line 131 of file ../../src/media/audio/drivers/tests/test_base.h
const std::vector<fuchsia::hardware::audio::PcmSupportedFormats> & ring_buffer_pcm_formats ()
Defined at line 170 of file ../../src/media/audio/drivers/tests/test_base.h
std::vector<fuchsia::hardware::audio::PcmSupportedFormats> & ring_buffer_pcm_formats ()
Defined at line 175 of file ../../src/media/audio/drivers/tests/test_base.h
std::vector<fuchsia::hardware::audio::DaiSupportedFormats> & dai_formats ()
Defined at line 179 of file ../../src/media/audio/drivers/tests/test_base.h
fidl::InterfacePtr<fuchsia::hardware::audio::Codec> & codec ()
Defined at line 181 of file ../../src/media/audio/drivers/tests/test_base.h
fidl::InterfacePtr<fuchsia::hardware::audio::Composite> & composite ()
Defined at line 182 of file ../../src/media/audio/drivers/tests/test_base.h
fidl::InterfacePtr<fuchsia::hardware::audio::Dai> & dai ()
Defined at line 183 of file ../../src/media/audio/drivers/tests/test_base.h
fidl::InterfacePtr<fuchsia::hardware::audio::StreamConfig> & stream_config ()
Defined at line 184 of file ../../src/media/audio/drivers/tests/test_base.h
template <typename DeviceType, typename ConnectorType = void>
fidl::InterfaceHandle<DeviceType> ConnectWithTrampoline (const DeviceEntry & device_entry)
Given this device_entry, use its channel to open the device.
Defined at line 185 of file ../../src/media/audio/drivers/tests/test_base.cc
void WaitForError (zx::duration wait_duration)
Verifies that the driver channel remains healthy and responsive.
Usage hints:
- Use this to ensure the driver hasn't disconnected after "fire-and-forget"
commands (requests without a completion callback).
- Generally NOT needed if the previous step already waits for a response
(e.g. ExpectCallbacks), as that implicitly verifies channel health.
- Can be used to flush pipelined requests or pending callbacks when no
explicit response is expected.
Defined at line 197 of file ../../src/media/audio/drivers/tests/test_base.h
template <typename DeviceType>
DeviceType Connect (const DeviceEntry & device_entry)
Defined at line 198 of file ../../src/media/audio/drivers/tests/test_base.cc
void ConnectToBluetoothDevice ()
Defined at line 142 of file ../../src/media/audio/drivers/tests/test_base.cc
std::optional<BaseProperties> & properties ()
Defined at line 219 of file ../../src/media/audio/drivers/tests/test_base.h
const std::optional<BaseProperties> & properties ()
Defined at line 220 of file ../../src/media/audio/drivers/tests/test_base.h
void CreateCodecFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::Codec> channel)
Defined at line 223 of file ../../src/media/audio/drivers/tests/test_base.cc
void CreateCompositeFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::Composite> channel)
Defined at line 235 of file ../../src/media/audio/drivers/tests/test_base.cc
void CreateDaiFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::Dai> channel)
Defined at line 247 of file ../../src/media/audio/drivers/tests/test_base.cc
void CreateStreamConfigFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::StreamConfig> channel)
Defined at line 258 of file ../../src/media/audio/drivers/tests/test_base.cc
std::optional<bool> IsIncoming ()
Defined at line 489 of file ../../src/media/audio/drivers/tests/test_base.cc
void RequestHealthAndExpectHealthy ()
Requests on protocols that are composesd into StreamConfig/Dai/Codec/Composite.
fuchsia.hardware.audio.Health
We expect a response, and we allow 'healthy' to be either unspecified or TRUE.
Defined at line 274 of file ../../src/media/audio/drivers/tests/test_base.cc
void GetHealthState (fuchsia::hardware::audio::Health::GetHealthStateCallback cb)
Defined at line 281 of file ../../src/media/audio/drivers/tests/test_base.cc
void RetrieveProperties ()
BasicTest (non-destructive) and AdminTest (destructive or RingBuffer) cases both need to
know at least whether ring buffers are outgoing or incoming, so this is implemented in this
shared parent class.
Defined at line 298 of file ../../src/media/audio/drivers/tests/test_base.cc
void ValidateProperties ()
Defined at line 410 of file ../../src/media/audio/drivers/tests/test_base.cc
void DisplayBaseProperties ()
For debugging purposes
Defined at line 450 of file ../../src/media/audio/drivers/tests/test_base.cc
void RetrieveDaiFormats ()
BasicTest (non-destructive) and AdminTest (destructive or RingBuffer) cases both need to
know the supported formats, so this is implemented in this shared parent class.
Defined at line 511 of file ../../src/media/audio/drivers/tests/test_base.cc
void ValidateDaiFormatSets (const std::vector<fuchsia::hardware::audio::DaiSupportedFormats> & dai_format_sets)
Fail if the returned formats are not complete, unique and within ranges.
Consider defining FIDL constants for min/max channels, frame_rate, bits_per_slot/sample, etc.
Defined at line 549 of file ../../src/media/audio/drivers/tests/test_base.cc
void LogDaiFormatSets (const std::vector<fuchsia::hardware::audio::DaiSupportedFormats> & dai_format_sets, const std::string & tag)
For debugging purposes
Defined at line 682 of file ../../src/media/audio/drivers/tests/test_base.cc
void ValidateDaiFormat (const fuchsia::hardware::audio::DaiFormat & dai_format)
Defined at line 828 of file ../../src/media/audio/drivers/tests/test_base.cc
void LogDaiFormat (const fuchsia::hardware::audio::DaiFormat & format, const std::string & tag)
For debugging purposes
Defined at line 852 of file ../../src/media/audio/drivers/tests/test_base.cc
fuchsia::hardware::audio::DaiFormat GetMinDaiFormat (const std::vector<fuchsia::hardware::audio::DaiSupportedFormats> & dai_format_sets)
Defined at line 722 of file ../../src/media/audio/drivers/tests/test_base.cc
fuchsia::hardware::audio::DaiFormat GetMaxDaiFormat (const std::vector<fuchsia::hardware::audio::DaiSupportedFormats> & dai_format_sets)
Defined at line 775 of file ../../src/media/audio/drivers/tests/test_base.cc
const std::vector<fuchsia::hardware::audio::DaiSupportedFormats> & dai_formats ()
Defined at line 863 of file ../../src/media/audio/drivers/tests/test_base.cc
void RetrieveRingBufferFormats ()
Request that the driver return the format ranges that it supports.
Defined at line 868 of file ../../src/media/audio/drivers/tests/test_base.cc
void ValidatePcmSupportedFormats (const std::vector<fuchsia::hardware::audio::PcmSupportedFormats> & pcm_format_sets)
Fail if the returned formats are not complete, unique and within ranges.
Defined at line 911 of file ../../src/media/audio/drivers/tests/test_base.cc
void LogPcmFormat (const fuchsia::hardware::audio::PcmFormat & format, const std::string & tag)
Defined at line 1136 of file ../../src/media/audio/drivers/tests/test_base.cc
fuchsia::hardware::audio::PcmFormat GetMinPcmFormat (const std::vector<fuchsia::hardware::audio::PcmSupportedFormats> & pcm_format_sets)
Defined at line 1042 of file ../../src/media/audio/drivers/tests/test_base.cc
fuchsia::hardware::audio::PcmFormat GetMaxPcmFormat (const std::vector<fuchsia::hardware::audio::PcmSupportedFormats> & pcm_format_sets)
Defined at line 1089 of file ../../src/media/audio/drivers/tests/test_base.cc