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

Side by Side Diff: media/audio/audio_input_volume_unittest.cc

Issue 9570014: Move some generic functions to AudioManagerBase to be inherited by platform-specific AudioManager*** (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the memory leak in the alsa unittests Created 8 years, 9 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 | Annotate | Revision Log
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 <cmath> 5 #include <cmath>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/win/scoped_com_initializer.h" 8 #include "base/win/scoped_com_initializer.h"
9 #include "media/audio/audio_io.h" 9 #include "media/audio/audio_io.h"
10 #include "media/audio/audio_manager_base.h" 10 #include "media/audio/audio_manager_base.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 scoped_ptr<AudioManager> audio_manager_; 88 scoped_ptr<AudioManager> audio_manager_;
89 ScopedCOMInitializer com_init_; 89 ScopedCOMInitializer com_init_;
90 }; 90 };
91 91
92 TEST_F(AudioInputVolumeTest, InputVolumeTest) { 92 TEST_F(AudioInputVolumeTest, InputVolumeTest) {
93 if (!CanRunAudioTests()) 93 if (!CanRunAudioTests())
94 return; 94 return;
95 95
96 AudioDeviceNames device_names; 96 AudioDeviceNames device_names;
97 audio_manager_->GetAudioInputDeviceNames(&device_names); 97 audio_manager_->GetAudioInputDeviceNames(&device_names);
98 DCHECK(!device_names.empty()); 98 if (device_names.empty())
99 return;
tommi (sloooow) - chröme 2012/03/05 14:28:28 LOG(WARNING)
no longer working on chromium 2012/03/06 15:27:07 Done.
99 100
100 for (AudioDeviceNames::const_iterator it = device_names.begin(); 101 for (AudioDeviceNames::const_iterator it = device_names.begin();
101 it != device_names.end(); 102 it != device_names.end();
102 ++it) { 103 ++it) {
103 AudioInputStream* ais = CreateAndOpenStream(it->unique_id); 104 AudioInputStream* ais = CreateAndOpenStream(it->unique_id);
104 if (!ais) { 105 if (!ais) {
105 DLOG(WARNING) << "Failed to open stream for device " << it->unique_id; 106 DLOG(WARNING) << "Failed to open stream for device " << it->unique_id;
106 continue; 107 continue;
107 } 108 }
108 109
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_GT(current_volume, 0); 143 EXPECT_GT(current_volume, 0);
143 144
144 // Restores the volume to the original value. 145 // Restores the volume to the original value.
145 ais->SetVolume(original_volume); 146 ais->SetVolume(original_volume);
146 current_volume = ais->GetVolume(); 147 current_volume = ais->GetVolume();
147 EXPECT_EQ(original_volume, current_volume); 148 EXPECT_EQ(original_volume, current_volume);
148 149
149 ais->Close(); 150 ais->Close();
150 } 151 }
151 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698