| Index: media/audio/mac/audio_output_mac_unittest.cc
|
| ===================================================================
|
| --- media/audio/mac/audio_output_mac_unittest.cc (revision 114012)
|
| +++ media/audio/mac/audio_output_mac_unittest.cc (working copy)
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "media/audio/audio_io.h"
|
| #include "media/audio/audio_manager.h"
|
| #include "media/audio/simple_sources.h"
|
| @@ -47,13 +48,12 @@
|
| // ===========================================================================
|
| // Validation of AudioParameters::AUDIO_PCM_LINEAR
|
| //
|
| -// Unlike windows, the tests can reliably detect the existense of real
|
| +// Unlike windows, the tests can reliably detect the existence of real
|
| // audio devices on the bots thus no need for 'headless' detection.
|
|
|
| // Test that can it be created and closed.
|
| TEST(MacAudioTest, PCMWaveStreamGetAndClose) {
|
| - AudioManager* audio_man = AudioManager::GetAudioManager();
|
| - ASSERT_TRUE(NULL != audio_man);
|
| + scoped_refptr<AudioManager> audio_man(AudioManager::Create());
|
| if (!audio_man->HasAudioOutputDevices())
|
| return;
|
| AudioOutputStream* oas = audio_man->MakeAudioOutputStream(
|
| @@ -65,8 +65,7 @@
|
|
|
| // Test that it can be opened and closed.
|
| TEST(MacAudioTest, PCMWaveStreamOpenAndClose) {
|
| - AudioManager* audio_man = AudioManager::GetAudioManager();
|
| - ASSERT_TRUE(NULL != audio_man);
|
| + scoped_refptr<AudioManager> audio_man(AudioManager::Create());
|
| if (!audio_man->HasAudioOutputDevices())
|
| return;
|
| AudioOutputStream* oas = audio_man->MakeAudioOutputStream(
|
| @@ -82,8 +81,7 @@
|
| // pops or noises while the sound is playing. The sound must also be identical
|
| // to the sound of PCMWaveStreamPlay200HzTone22KssMono test.
|
| TEST(MacAudioTest, PCMWaveStreamPlay200HzTone44KssMono) {
|
| - AudioManager* audio_man = AudioManager::GetAudioManager();
|
| - ASSERT_TRUE(NULL != audio_man);
|
| + scoped_refptr<AudioManager> audio_man(AudioManager::Create());
|
| if (!audio_man->HasAudioOutputDevices())
|
| return;
|
| uint32 frames_100_ms = AudioParameters::kAudioCDSampleRate / 10;
|
| @@ -113,8 +111,7 @@
|
| // or noises while the sound is playing. The sound must also be identical to the
|
| // sound of PCMWaveStreamPlay200HzTone44KssMono test.
|
| TEST(MacAudioTest, PCMWaveStreamPlay200HzTone22KssMono) {
|
| - AudioManager* audio_man = AudioManager::GetAudioManager();
|
| - ASSERT_TRUE(NULL != audio_man);
|
| + scoped_refptr<AudioManager> audio_man(AudioManager::Create());
|
| if (!audio_man->HasAudioOutputDevices())
|
| return;
|
| uint32 frames_100_ms = AudioParameters::kAudioCDSampleRate / 10;
|
| @@ -140,8 +137,7 @@
|
| }
|
|
|
| TEST(MacAudioTest, PCMWaveStreamPendingBytes) {
|
| - AudioManager* audio_man = AudioManager::GetAudioManager();
|
| - ASSERT_TRUE(NULL != audio_man);
|
| + scoped_refptr<AudioManager> audio_man(AudioManager::Create());
|
| if (!audio_man->HasAudioOutputDevices())
|
| return;
|
|
|
|
|