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

Unified Diff: content/renderer/media/webrtc_audio_device_unittest.cc

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Set svn eol properties for a couple of files Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/speech/speech_recognizer_unittest.cc ('k') | content/test/webrtc_audio_device_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_device_unittest.cc
===================================================================
--- content/renderer/media/webrtc_audio_device_unittest.cc (revision 114012)
+++ content/renderer/media/webrtc_audio_device_unittest.cc (working copy)
@@ -157,39 +157,9 @@
} // end namespace
-// Utility class to delete the AudioManager.
-// TODO(tommi): Remove when we've fixed issue 105249.
-class AutoAudioManagerCleanup {
- public:
- AutoAudioManagerCleanup() {
- // Log an error if a previous test didn't clean up the AudioManager.
- if (DeleteAndResurrect()) {
- LOG(ERROR)
- << "AudioManager singleton was not cleaned up by some previous test!";
- }
- }
- ~AutoAudioManagerCleanup() {
- DeleteAndResurrect();
- }
-
- private:
- // Returns true iff the AudioManager existed and was deleted.
- bool DeleteAndResurrect() {
- if (AudioManager::SingletonExists()) {
- AudioManager::Destroy(NULL);
- AudioManager::Resurrect();
- return true;
- }
- return false;
- }
-
- DISALLOW_COPY_AND_ASSIGN(AutoAudioManagerCleanup);
-};
-
// Basic test that instantiates and initializes an instance of
// WebRtcAudioDeviceImpl.
TEST_F(WebRTCAudioDeviceTest, Construct) {
- AutoAudioManagerCleanup audio_manager_cleanup;
AudioUtilNoHardware audio_util(48000.0, 48000.0);
SetAudioUtilCallback(&audio_util);
scoped_refptr<WebRtcAudioDeviceImpl> audio_device(
@@ -212,8 +182,6 @@
// verify that streaming starts correctly.
// Disabled when running headless since the bots don't have the required config.
TEST_F(WebRTCAudioDeviceTest, StartPlayout) {
- AutoAudioManagerCleanup audio_manager_cleanup;
-
if (IsRunningHeadless())
return;
@@ -286,8 +254,6 @@
// that the audio capturing starts as it should.
// Disabled when running headless since the bots don't have the required config.
TEST_F(WebRTCAudioDeviceTest, StartRecording) {
- AutoAudioManagerCleanup audio_manager_cleanup;
-
if (IsRunningHeadless())
return;
@@ -355,8 +321,6 @@
// Uses WebRtcAudioDeviceImpl to play a local wave file.
// Disabled when running headless since the bots don't have the required config.
TEST_F(WebRTCAudioDeviceTest, PlayLocalFile) {
- AutoAudioManagerCleanup audio_manager_cleanup;
-
if (IsRunningHeadless())
return;
@@ -403,11 +367,16 @@
EXPECT_EQ(0, file->StartPlayingFileLocally(ch, file_path.c_str(), false,
webrtc::kFileFormatPcm16kHzFile));
+ // Play 2 seconds worth of audio and then quit.
message_loop_.PostDelayedTask(FROM_HERE,
MessageLoop::QuitClosure(),
- TestTimeouts::action_timeout_ms());
+ 2000);
message_loop_.Run();
+
+ EXPECT_EQ(0, base->StopSend(ch));
+ EXPECT_EQ(0, base->StopPlayout(ch));
+ EXPECT_EQ(0, base->DeleteChannel(ch));
EXPECT_EQ(0, base->Terminate());
}
@@ -420,8 +389,6 @@
// TODO(henrika): improve quality by using a wideband codec, enabling noise-
// suppressions and perhaps also the digital AGC.
TEST_F(WebRTCAudioDeviceTest, FullDuplexAudio) {
- AutoAudioManagerCleanup audio_manager_cleanup;
-
if (IsRunningHeadless())
return;
« no previous file with comments | « content/browser/speech/speech_recognizer_unittest.cc ('k') | content/test/webrtc_audio_device_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698