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

Side by Side Diff: media/audio/win/audio_low_latency_output_win_unittest.cc

Issue 23523023: Add GetOutputStreamParameters, GetAssociatedOutputDeviceID to AudioManager. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698