src/media/audio/audio_core/test/api/audio_capturer_test.cc
TEST_F(AudioCapturerTest, DiscardAllNoReply_AfterAsyncCapture) {
  SetFormat();
  SetUpPayloadBuffer();

  audio_capturer_.events().OnPacketProduced = AddCallback("OnPacketProduced");
  audio_capturer_->StartAsyncCapture(1600);
  ExpectCallback();

  audio_capturer_->StopAsyncCapture(AddCallback("StopAsyncCapture"));
  ExpectCallback();

  audio_capturer_->DiscardAllPacketsNoReply();
  RunLoopUntilIdle();
}
// DiscardAllPacketsNoReply should succeed, if async capture is completely stopped
DiscardAllPacketsNoReply should succeed, if async capture is completely stopped
DiscardAllPacketsNoReply should succeed if async capture is completely stopped
TEST_F(AudioCapturerTest, DiscardAllNoReply_AfterAsyncCapture) {
  SetFormat();
  SetUpPayloadBuffer();
  audio_capturer_.events().OnPacketProduced = AddCallback("OnPacketProduced");
  audio_capturer_->StartAsyncCapture(1600);
  ExpectCallback();
  audio_capturer_->StopAsyncCapture(AddCallback("StopAsyncCapture"));
  ExpectCallback();
  audio_capturer_->DiscardAllPacketsNoReply();
  RunLoopUntilIdle();
}
TEST_F ( AudioCapturerTest , DiscardAllNoReply_AfterAsyncCapture ) { SetFormat ( ) ; SetUpPayloadBuffer ( ) ; audio_capturer_ . events ( ) . OnPacketProduced = AddCallback ( " " ) ; audio_capturer_ -> StartAsyncCapture ( 1600 ) ; ExpectCallback ( ) ; audio_capturer_ -> StopAsyncCapture ( AddCallback ( " " ) ) ; ExpectCallback ( ) ; audio_capturer_ -> DiscardAllPacketsNoReply ( ) ; RunLoopUntilIdle ( ) ; }
DiscardAllPacketsNoReply should succeed, if async capture is completely stopped
DiscardAllPacketsNoReply should succeed if async capture is completely stopped