class HermeticAudioTest

Defined at line 53 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 45 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

HermeticAudioRealm & realm ()

Defined at line 82 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 100 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 105 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void SetUp ()

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

fuchsia::thermal::ClientStateConnectorPtr & thermal_client_state_connector ()

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

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

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

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

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

void TearDown ()

Defined at line 177 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 199 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 224 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 249 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 264 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 276 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 291 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 573 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

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

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

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

Defined at line 588 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 521 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 529 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 542 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 554 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 565 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

bool DeviceHasUnderflows (const std::string & unique_id)

Defined at line 630 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 304 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

void Unbind (CapturerShimImpl * capturer)

Defined at line 314 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 325 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 331 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 469 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 484 of file ../../src/media/audio/audio_core/testing/integration/hermetic_audio_test.cc

Records