src/media/audio/audio_core/test/api/audio_capturer_test.cc
// DiscardAllPackets waits to deliver its completion callback until all packets have returned.
DiscardAllPackets waits to deliver its completion callback until all packets have returned.
DiscardAllPackets waits to deliver its completion callback until all packets have returned .
TEST_F(AudioCapturerTest, DiscardAll_ReturnsAfterAllPackets) {
  SetFormat();
  SetUpPayloadBuffer();
  audio_capturer_->CaptureAt(0, 0, 4000, AddCallback("CaptureAt 0"));
  audio_capturer_->CaptureAt(0, 4000, 4000, AddCallback("CaptureAt 4000"));
  audio_capturer_->CaptureAt(0, 8000, 4000, AddCallback("CaptureAt 8000"));
  audio_capturer_->CaptureAt(0, 12000, 4000, AddCallback("CaptureAt 12000"));
  audio_capturer_->DiscardAllPackets(AddCallback("DiscardAllPackets"));
  ExpectCallback();
}
TEST_F ( AudioCapturerTest , DiscardAll_ReturnsAfterAllPackets ) { SetFormat ( ) ; SetUpPayloadBuffer ( ) ; audio_capturer_ -> CaptureAt ( 0 , 0 , 4000 , AddCallback ( " " ) ) ; audio_capturer_ -> CaptureAt ( 0 , 4000 , 4000 , AddCallback ( " " ) ) ; audio_capturer_ -> CaptureAt ( 0 , 8000 , 4000 , AddCallback ( " " ) ) ; audio_capturer_ -> CaptureAt ( 0 , 12000 , 4000 , AddCallback ( " " ) ) ; audio_capturer_ -> DiscardAllPackets ( AddCallback ( " " ) ) ; ExpectCallback ( ) ; }
DiscardAllPackets waits to deliver its completion callback until all packets have returned.
DiscardAllPackets waits to deliver its completion callback until all packets have returned .
// Packets should complete in strict order, with DiscardAllPackets' completion afterward.