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 41 of file ../../src/media/audio/drivers/tests/test_base.cc

void TearDown ()

Defined at line 77 of file ../../src/media/audio/drivers/tests/test_base.cc

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 145 of file ../../src/media/audio/drivers/tests/test_base.cc

template <typename DeviceType>
DeviceType Connect (const DeviceEntry & device_entry)

Defined at line 158 of file ../../src/media/audio/drivers/tests/test_base.cc

void ConnectToBluetoothDevice ()

Defined at line 102 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

void CreateCodecFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::Codec> channel)

Defined at line 170 of file ../../src/media/audio/drivers/tests/test_base.cc

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

void CreateCompositeFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::Composite> channel)

Defined at line 182 of file ../../src/media/audio/drivers/tests/test_base.cc

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

void CreateDaiFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::Dai> channel)

Defined at line 194 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

void CreateStreamConfigFromChannel (fidl::InterfaceHandle<fuchsia::hardware::audio::StreamConfig> channel)

Defined at line 205 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

std::optional<bool> IsIncoming ()

Defined at line 436 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 221 of file ../../src/media/audio/drivers/tests/test_base.cc

void GetHealthState (fuchsia::hardware::audio::Health::GetHealthStateCallback cb)

Defined at line 228 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 245 of file ../../src/media/audio/drivers/tests/test_base.cc

void ValidateProperties ()

Defined at line 357 of file ../../src/media/audio/drivers/tests/test_base.cc

void DisplayBaseProperties ()

For debugging purposes

Defined at line 397 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 458 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 496 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 629 of file ../../src/media/audio/drivers/tests/test_base.cc

void ValidateDaiFormat (const fuchsia::hardware::audio::DaiFormat & dai_format)

Defined at line 775 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 799 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 669 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 722 of file ../../src/media/audio/drivers/tests/test_base.cc

const std::vector<fuchsia::hardware::audio::DaiSupportedFormats> & dai_formats ()

Defined at line 810 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 815 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 858 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 1083 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 989 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 1036 of file ../../src/media/audio/drivers/tests/test_base.cc

Records