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

Side by Side Diff: media/audio/cras/cras_unified_unittest.cc

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years 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 unified diff | Download patch
« no previous file with comments | « media/audio/cras/cras_unified.cc ('k') | media/audio/fake_audio_input_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "media/audio/cras/audio_manager_cras.h" 10 #include "media/audio/cras/audio_manager_cras.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 TEST_F(CrasUnifiedStreamTest, RenderFrames) { 137 TEST_F(CrasUnifiedStreamTest, RenderFrames) {
138 CrasUnifiedStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); 138 CrasUnifiedStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO);
139 MockAudioSourceCallback mock_callback; 139 MockAudioSourceCallback mock_callback;
140 140
141 ASSERT_TRUE(test_stream->Open()); 141 ASSERT_TRUE(test_stream->Open());
142 142
143 base::WaitableEvent event(false, false); 143 base::WaitableEvent event(false, false);
144 144
145 EXPECT_CALL(mock_callback, OnMoreData(_, _)) 145 EXPECT_CALL(mock_callback, OnMoreData(_, _, 0))
146 .WillRepeatedly(DoAll( 146 .WillRepeatedly(
147 InvokeWithoutArgs(&event, &base::WaitableEvent::Signal), 147 DoAll(InvokeWithoutArgs(&event, &base::WaitableEvent::Signal),
148 Return(kTestFramesPerPacket))); 148 Return(kTestFramesPerPacket)));
149 149
150 test_stream->Start(&mock_callback); 150 test_stream->Start(&mock_callback);
151 151
152 // Wait for samples to be captured. 152 // Wait for samples to be captured.
153 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); 153 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout()));
154 154
155 test_stream->Stop(); 155 test_stream->Stop();
156 156
157 test_stream->Close(); 157 test_stream->Close();
158 } 158 }
159 159
160 } // namespace media 160 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/cras/cras_unified.cc ('k') | media/audio/fake_audio_input_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698