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

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

Issue 290003002: Remove OnMoreIOData() (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed the media unittests on mac. Created 6 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 unified diff | Download patch
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 <list> 5 #include <list>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/rand_util.h" 9 #include "base/rand_util.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 virtual ~TestAudioSource() {} 66 virtual ~TestAudioSource() {}
67 67
68 virtual int OnMoreData(AudioBus* audio_bus, 68 virtual int OnMoreData(AudioBus* audio_bus,
69 AudioBuffersState audio_buffers) OVERRIDE { 69 AudioBuffersState audio_buffers) OVERRIDE {
70 const int ret = SineWaveAudioSource::OnMoreData(audio_bus, audio_buffers); 70 const int ret = SineWaveAudioSource::OnMoreData(audio_bus, audio_buffers);
71 data_pulled_.Signal(); 71 data_pulled_.Signal();
72 return ret; 72 return ret;
73 } 73 }
74 74
75 virtual int OnMoreIOData(AudioBus* source,
76 AudioBus* dest,
77 AudioBuffersState audio_buffers) OVERRIDE {
78 const int ret =
79 SineWaveAudioSource::OnMoreIOData(source, dest, audio_buffers);
80 data_pulled_.Signal();
81 return ret;
82 }
83
84 void WaitForDataPulls() { 75 void WaitForDataPulls() {
85 for (int i = 0; i < 3; ++i) { 76 for (int i = 0; i < 3; ++i) {
86 data_pulled_.Wait(); 77 data_pulled_.Wait();
87 } 78 }
88 } 79 }
89 80
90 private: 81 private:
91 base::WaitableEvent data_pulled_; 82 base::WaitableEvent data_pulled_;
92 83
93 DISALLOW_COPY_AND_ASSIGN(TestAudioSource); 84 DISALLOW_COPY_AND_ASSIGN(TestAudioSource);
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 337 }
347 RUN_ON_AUDIO_THREAD(Close); 338 RUN_ON_AUDIO_THREAD(Close);
348 WaitUntilClosed(); 339 WaitUntilClosed();
349 } 340 }
350 341
351 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, 342 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded,
352 VirtualAudioInputStreamTest, 343 VirtualAudioInputStreamTest,
353 ::testing::Values(false, true)); 344 ::testing::Values(false, true));
354 345
355 } // namespace media 346 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/sounds/audio_stream_handler.cc ('k') | media/audio/win/audio_low_latency_output_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698