src/media/audio/drivers/test/admin_test.cc
// Within the next position notification, Stop and fail on any subsequent position notification.
Within the next position notification, Stop and fail on any subsequent position notification.
Within the next position notification Stop and fail on any subsequent position notification .
void AdminTest::RequestStopAndExpectNoPositionNotifications() {
  if (device_access_denied()) {
    return;
  }
  ASSERT_TRUE(received_start_);
  watch_for_next_position_notification_ = false;
  ring_buffer_->WatchClockRecoveryPositionInfo(
      [this](fuchsia::hardware::audio::RingBufferPositionInfo) {
        ring_buffer_->Stop([this]() { received_stop_ = true; });
        SetFailingPositionNotification();
      });
  RunLoopUntil([this]() { return received_stop_ || device_access_denied(); });
  zx::nanosleep(zx::deadline_after(zx::sec(1)));
  RunLoopUntilIdle();
}
void AdminTest :: RequestStopAndExpectNoPositionNotifications ( ) { if ( device_access_denied ( ) ) { return ; } ASSERT_TRUE ( received_start_ ) ; watch_for_next_position_notification_ = false ; ring_buffer_ -> WatchClockRecoveryPositionInfo ( [ this ] ( fuchsia :: hardware :: audio :: RingBufferPositionInfo ) { ring_buffer_ -> Stop ( [ this ] ( ) { received_stop_ = true ; } ) ; SetFailingPositionNotification ( ) ; } ) ; RunLoopUntil ( [ this ] ( ) { return received_stop_ || device_access_denied ( ) ; } ) ; zx :: nanosleep ( zx :: deadline_after ( zx :: sec ( 1 ) ) ) ; RunLoopUntilIdle ( ) ; }
Within the next position notification, Stop and fail on any subsequent position notification.
Within the next position notification Stop and fail on any subsequent position notification .
// Disable any last pending notification from re-queueing itself. // We should NOT receive further position notifications. Wait a bit to give them a chance to run.