class HermeticAudioTest

Defined at line 36 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.h

Restrictions on usage:

1. This class is thread hostile: none of its methods can be called concurrently.

2. It is illegal for two or more instances to be alive at any time. (This restriction

is satisfied by ordinary usage of gtest.)

Protected Members

InterfacePtr audio_core_
InterfacePtr audio_dev_enum_
static const bool kEnableAllOverflowAndUnderflowChecksInRealtimeTests

Protected Methods

component_testing::DirectoryContents MakeAudioCoreConfig (AudioCoreConfigOptions options)

Creates a directory with an audio_core_config.json file.

Defined at line 44 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

HermeticAudioRealm & realm ()

Defined at line 65 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.h

void SetTestSuiteRealmOptions (std::function<HermeticAudioRealm::Options ()> )

TestSuite functions are run once per test suite; a suite can configure

HermeticAudioRealm::Options for all tests by calling `SetTestSuiteRealmOptions()`

in an override of `SetUpTestSuite()`.

Defined at line 99 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void SetUpTestSuite ()

The default implementation calls SetTestSuiteRealmOptions() with default Options.

Test suites can override this to provide custom behavior.

Defined at line 104 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void SetUp ()

Defined at line 127 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

fuchsia::thermal::ClientStateConnectorPtr & thermal_client_state_connector ()

Defined at line 151 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.h

::test::thermal::ClientStateControlSyncPtr & thermal_test_client_state_control ()

Defined at line 154 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.h

fuchsia::media::audio::EffectsControllerSyncPtr & effects_controller ()

Defined at line 157 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.h

void TearDown ()

Defined at line 176 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
VirtualOutput<SampleFormat> * CreateOutput (const audio_stream_unique_id_t & device_id, TypedFormat<SampleFormat> format, int64_t frame_count, std::optional<VirtualDevice::PlugProperties> plug_properties, float device_gain_db, std::optional<VirtualDevice::ClockProperties> device_clock_properties)

The returned pointers are owned by this class.

Defined at line 198 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
VirtualInput<SampleFormat> * CreateInput (const audio_stream_unique_id_t & device_id, TypedFormat<SampleFormat> format, int64_t frame_count, std::optional<VirtualDevice::PlugProperties> plug_properties, float device_gain_db, std::optional<VirtualDevice::ClockProperties> device_clock_properties)

Defined at line 223 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
AudioRendererShim<SampleFormat> * CreateAudioRenderer (TypedFormat<SampleFormat> format, int64_t frame_count, fuchsia::media::AudioRenderUsage2 usage, std::optional<zx::clock> reference_clock, std::optional<float> initial_gain_db)

Defined at line 248 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
AudioCapturerShim<SampleFormat> * CreateAudioCapturer (TypedFormat<SampleFormat> format, int64_t frame_count, fuchsia::media::AudioCapturerConfiguration config)

Defined at line 263 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
UltrasoundRendererShim<SampleFormat> * CreateUltrasoundRenderer (TypedFormat<SampleFormat> format, int64_t frame_count, bool wait_for_creation)

Defined at line 275 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
UltrasoundCapturerShim<SampleFormat> * CreateUltrasoundCapturer (TypedFormat<SampleFormat> format, int64_t frame_count, bool wait_for_creation)

Defined at line 290 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectInspectMetrics (VirtualDevice * device, const std::string & unique_id, const ExpectedInspectProperties & props)

Validate inspect metrics.

Defined at line 572 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectInspectMetrics (RendererShimImpl * renderer, const ExpectedInspectProperties & props)

Defined at line 582 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectInspectMetrics (CapturerShimImpl * capturer, const ExpectedInspectProperties & props)

Defined at line 587 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectNoOverflowsOrUnderflows ()

Fail the test if any overflow or underflow is reported. This includes the below four subcases:

* Output underflow: data was lost because we awoke too late to provide data.

* Pipeline underflow: pipeline processing took longer than expected (for now, this includes

cases where the time overrun did not necessarily result in data loss).

* Renderer underflow: data was lost because a renderer client provided it to us too late.

* Capturer overflow: data was lost because we had no available buffer from a capturer-client.

Defined at line 520 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectNoOutputUnderflows ()

Fail if data was lost because we awoke too late to provide data.

Defined at line 528 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectNoPipelineUnderflows ()

Fail if pipeline processing took longer than expected (for now this includes cases where the

time overrun did not necessarily result in data loss).

Defined at line 541 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectNoRendererUnderflows ()

Fail if data was lost because a renderer client provided it to us too late.

Defined at line 553 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void ExpectNoCapturerOverflows ()

Fail if data was lost because we had no available buffer from a capturer-client.

Defined at line 564 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

bool DeviceHasUnderflows (const std::string & unique_id)

Defined at line 618 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void Unbind (VirtualDevice * device)

Unbind and forget about the given object.

Defined at line 303 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void Unbind (CapturerShimImpl * capturer)

Defined at line 313 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
void Unbind (AudioRendererShim<SampleFormat> * renderer)

Defined at line 324 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

template <fuchsia::media::AudioSampleFormat SampleFormat>
void Unbind (UltrasoundRendererShim<SampleFormat> * renderer)

Defined at line 330 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

fuchsia::media::AudioDeviceEnumeratorPtr TakeOwnershipOfAudioDeviceEnumerator ()

Takes ownership of the AudioDeviceEnumerator. This is useful when tests need to watch for

low-level device enumeration events. This is incompatible with CreateInput and CreateOutput.

Defined at line 468 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

zx_status_t ConfigurePipelineForThermal (uint32_t thermal_state)

Change the output pipeline's thermal state, blocking until the state change completes.

Defined at line 483 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

Records