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 <windows.h> | 5 #include <windows.h> |
6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 TEST(WASAPIAudioOutputStreamTest, HardwareSampleRate) { | 261 TEST(WASAPIAudioOutputStreamTest, HardwareSampleRate) { |
262 // Skip this test in exclusive mode since the resulting rate is only utilized | 262 // Skip this test in exclusive mode since the resulting rate is only utilized |
263 // for shared mode streams. | 263 // for shared mode streams. |
264 scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); | 264 scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); |
265 if (!CanRunAudioTests(audio_manager.get()) || ExclusiveModeIsEnabled()) | 265 if (!CanRunAudioTests(audio_manager.get()) || ExclusiveModeIsEnabled()) |
266 return; | 266 return; |
267 | 267 |
268 // Default device intended for games, system notification sounds, | 268 // Default device intended for games, system notification sounds, |
269 // and voice commands. | 269 // and voice commands. |
270 int fs = static_cast<int>( | 270 int fs = static_cast<int>( |
271 WASAPIAudioOutputStream::HardwareSampleRate()); | 271 WASAPIAudioOutputStream::HardwareSampleRate(std::string())); |
272 EXPECT_GE(fs, 0); | 272 EXPECT_GE(fs, 0); |
273 } | 273 } |
274 | 274 |
275 // Test Create(), Close() calling sequence. | 275 // Test Create(), Close() calling sequence. |
276 TEST(WASAPIAudioOutputStreamTest, CreateAndClose) { | 276 TEST(WASAPIAudioOutputStreamTest, CreateAndClose) { |
277 scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); | 277 scoped_ptr<AudioManager> audio_manager(AudioManager::Create()); |
278 if (!CanRunAudioTests(audio_manager.get())) | 278 if (!CanRunAudioTests(audio_manager.get())) |
279 return; | 279 return; |
280 AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); | 280 AudioOutputStream* aos = CreateDefaultAudioOutputStream(audio_manager.get()); |
281 aos->Close(); | 281 aos->Close(); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 694 |
695 aos->Start(&source); | 695 aos->Start(&source); |
696 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), | 696 loop.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), |
697 TestTimeouts::action_timeout()); | 697 TestTimeouts::action_timeout()); |
698 loop.Run(); | 698 loop.Run(); |
699 aos->Stop(); | 699 aos->Stop(); |
700 aos->Close(); | 700 aos->Close(); |
701 } | 701 } |
702 | 702 |
703 } // namespace media | 703 } // namespace media |
OLD | NEW |