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

Side by Side Diff: media/audio/audio_output_controller_unittest.cc

Issue 481193003: Remove AudioBuffersState usage in Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix audio muter build buster. Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | media/audio/audio_output_proxy_unittest.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 .Times(num_times_to_be_started); 185 .Times(num_times_to_be_started);
186 } 186 }
187 187
188 controller_->StartDiverting(&mock_stream_); 188 controller_->StartDiverting(&mock_stream_);
189 } 189 }
190 190
191 void ReadDivertedAudioData() { 191 void ReadDivertedAudioData() {
192 scoped_ptr<AudioBus> dest = AudioBus::Create(params_); 192 scoped_ptr<AudioBus> dest = AudioBus::Create(params_);
193 ASSERT_TRUE(!!mock_stream_.callback()); 193 ASSERT_TRUE(!!mock_stream_.callback());
194 const int frames_read = 194 const int frames_read =
195 mock_stream_.callback()->OnMoreData(dest.get(), AudioBuffersState()); 195 mock_stream_.callback()->OnMoreData(dest.get(), 0);
196 EXPECT_LT(0, frames_read); 196 EXPECT_LT(0, frames_read);
197 EXPECT_EQ(kBufferNonZeroData, dest->channel(0)[0]); 197 EXPECT_EQ(kBufferNonZeroData, dest->channel(0)[0]);
198 } 198 }
199 199
200 void Revert(bool was_playing) { 200 void Revert(bool was_playing) {
201 if (was_playing) { 201 if (was_playing) {
202 // Expect the handler to receive one OnPlaying() call as a result of the 202 // Expect the handler to receive one OnPlaying() call as a result of the
203 // stream switching back. 203 // stream switching back.
204 EXPECT_CALL(mock_event_handler_, OnPlaying()) 204 EXPECT_CALL(mock_event_handler_, OnPlaying())
205 .WillOnce(SignalEvent(&play_event_)); 205 .WillOnce(SignalEvent(&play_event_));
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 TEST_F(AudioOutputControllerTest, DivertRevertClose) { 406 TEST_F(AudioOutputControllerTest, DivertRevertClose) {
407 Create(kSamplesPerPacket); 407 Create(kSamplesPerPacket);
408 WaitForCreate(); 408 WaitForCreate();
409 DivertNeverPlaying(); 409 DivertNeverPlaying();
410 RevertWasNotPlaying(); 410 RevertWasNotPlaying();
411 Close(); 411 Close();
412 } 412 }
413 413
414 } // namespace media 414 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | media/audio/audio_output_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698