Chromium Code Reviews| 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 <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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |