OLD | NEW |
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/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 EXPECT_CALL(input_callback_, OnClose(_)); | 125 EXPECT_CALL(input_callback_, OnClose(_)); |
126 EXPECT_CALL(input_callback_, OnData(_, NotNull(), _, _, _)) | 126 EXPECT_CALL(input_callback_, OnData(_, NotNull(), _, _, _)) |
127 .Times(AtLeast(1)); | 127 .Times(AtLeast(1)); |
128 | 128 |
129 ASSERT_TRUE(!!stream_); | 129 ASSERT_TRUE(!!stream_); |
130 stream_->Start(&input_callback_); | 130 stream_->Start(&input_callback_); |
131 } | 131 } |
132 | 132 |
133 void CreateAndStartOneOutputStream() { | 133 void CreateAndStartOneOutputStream() { |
134 ASSERT_TRUE(!!stream_); | 134 ASSERT_TRUE(!!stream_); |
135 AudioOutputStream* const output_stream = | 135 AudioOutputStream* const output_stream = new VirtualAudioOutputStream( |
136 new VirtualAudioOutputStream( | 136 kParams, |
137 kParams, audio_message_loop_, stream_, | 137 audio_message_loop_.get(), |
138 base::Bind(&base::DeletePointer<VirtualAudioOutputStream>)); | 138 stream_, |
| 139 base::Bind(&base::DeletePointer<VirtualAudioOutputStream>)); |
139 output_streams_.push_back(output_stream); | 140 output_streams_.push_back(output_stream); |
140 | 141 |
141 output_stream->Open(); | 142 output_stream->Open(); |
142 output_stream->Start(&source_); | 143 output_stream->Start(&source_); |
143 } | 144 } |
144 | 145 |
145 void Stop() { | 146 void Stop() { |
146 ASSERT_TRUE(!!stream_); | 147 ASSERT_TRUE(!!stream_); |
147 stream_->Stop(); | 148 stream_->Stop(); |
148 } | 149 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 329 } |
329 RUN_ON_AUDIO_THREAD(Stop); | 330 RUN_ON_AUDIO_THREAD(Stop); |
330 for (int i = 0; i < kHalfNumOutputs; ++i) { | 331 for (int i = 0; i < kHalfNumOutputs; ++i) { |
331 RUN_ON_AUDIO_THREAD(StopAndCloseOneOutputStream); | 332 RUN_ON_AUDIO_THREAD(StopAndCloseOneOutputStream); |
332 } | 333 } |
333 RUN_ON_AUDIO_THREAD(Close); | 334 RUN_ON_AUDIO_THREAD(Close); |
334 WaitUntilClosed(); | 335 WaitUntilClosed(); |
335 } | 336 } |
336 | 337 |
337 } // namespace media | 338 } // namespace media |
OLD | NEW |