Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: media/audio/linux/alsa_output_unittest.cc

Issue 10413075: alsa_output: Drain and pause pcm when stopping. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: whitespace only. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/linux/alsa_output.cc ('k') | media/audio/linux/alsa_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/linux/alsa_output_unittest.cc
diff --git a/media/audio/linux/alsa_output_unittest.cc b/media/audio/linux/alsa_output_unittest.cc
index 4b314cebe5d28421a8edb9e50859ee583cb9db0c..5f9b4e77ba22dd3668e94857fa295da6837ec356 100644
--- a/media/audio/linux/alsa_output_unittest.cc
+++ b/media/audio/linux/alsa_output_unittest.cc
@@ -43,6 +43,7 @@ class MockAlsaWrapper : public AlsaWrapper {
snd_pcm_stream_t stream, int mode));
MOCK_METHOD1(PcmClose, int(snd_pcm_t* handle));
MOCK_METHOD1(PcmPrepare, int(snd_pcm_t* handle));
+ MOCK_METHOD1(PcmDrain, int(snd_pcm_t* handle));
MOCK_METHOD1(PcmDrop, int(snd_pcm_t* handle));
MOCK_METHOD2(PcmDelay, int(snd_pcm_t* handle, snd_pcm_sframes_t* delay));
MOCK_METHOD3(PcmWritei, snd_pcm_sframes_t(snd_pcm_t* handle,
@@ -458,6 +459,10 @@ TEST_F(AlsaPcmOutputStreamTest, StartStop) {
test_stream->Start(&mock_callback);
message_loop_.RunAllPending();
+ EXPECT_CALL(mock_alsa_wrapper_, PcmDrain(kFakeHandle))
+ .WillOnce(Return(0));
+ test_stream->Stop();
+
EXPECT_CALL(mock_alsa_wrapper_, PcmClose(kFakeHandle))
.WillOnce(Return(0));
EXPECT_CALL(mock_alsa_wrapper_, PcmName(kFakeHandle))
« no previous file with comments | « media/audio/linux/alsa_output.cc ('k') | media/audio/linux/alsa_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698