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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 ais->Stop(); | 184 ais->Stop(); |
185 ais->Close(); | 185 ais->Close(); |
186 } | 186 } |
187 | 187 |
188 // Test some additional calling sequences. | 188 // Test some additional calling sequences. |
189 TEST_F(MacAudioInputTest, AUAudioInputStreamMiscCallingSequences) { | 189 TEST_F(MacAudioInputTest, AUAudioInputStreamMiscCallingSequences) { |
190 ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); | 190 ABORT_AUDIO_TEST_IF_NOT(InputDevicesAvailable()); |
191 AudioInputStream* ais = CreateDefaultAudioInputStream(); | 191 AudioInputStream* ais = CreateDefaultAudioInputStream(); |
192 AUAudioInputStream* auais = static_cast<AUAudioInputStream*>(ais); | 192 AUAudioInputStream* auais = static_cast<AUAudioInputStream*>(ais); |
193 | 193 |
194 // Open(), Open() should fail the second time. | |
195 EXPECT_TRUE(ais->Open()); | 194 EXPECT_TRUE(ais->Open()); |
196 EXPECT_FALSE(ais->Open()); | |
henrika (OOO until Aug 14)
2016/02/05 13:58:05
We don't support this case on the output side or a
tommi (sloooow) - chröme
2016/02/05 14:06:51
Agree.
| |
197 | 195 |
198 MockAudioInputCallback sink; | 196 MockAudioInputCallback sink; |
199 | 197 |
200 // Start(), Start() is a valid calling sequence (second call does nothing). | 198 // Start(), Start() is a valid calling sequence (second call does nothing). |
201 ais->Start(&sink); | 199 ais->Start(&sink); |
202 EXPECT_TRUE(auais->IsRunning()); | 200 EXPECT_TRUE(auais->IsRunning()); |
203 ais->Start(&sink); | 201 ais->Start(&sink); |
204 EXPECT_TRUE(auais->IsRunning()); | 202 EXPECT_TRUE(auais->IsRunning()); |
205 | 203 |
206 // Stop(), Stop() is a valid calling sequence (second call does nothing). | 204 // Stop(), Stop() is a valid calling sequence (second call does nothing). |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 WriteToFileAudioSink file_sink(file_name); | 288 WriteToFileAudioSink file_sink(file_name); |
291 fprintf(stderr, " >> Speak into the mic while recording...\n"); | 289 fprintf(stderr, " >> Speak into the mic while recording...\n"); |
292 ais->Start(&file_sink); | 290 ais->Start(&file_sink); |
293 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); | 291 base::PlatformThread::Sleep(TestTimeouts::action_timeout()); |
294 ais->Stop(); | 292 ais->Stop(); |
295 fprintf(stderr, " >> Recording has stopped.\n"); | 293 fprintf(stderr, " >> Recording has stopped.\n"); |
296 ais->Close(); | 294 ais->Close(); |
297 } | 295 } |
298 | 296 |
299 } // namespace media | 297 } // namespace media |
OLD | NEW |