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" |
11 #include "media/audio/audio_util.h" | 11 #include "media/audio/audio_util.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using base::win::ScopedCOMInitializer; | 14 using base::win::ScopedCOMInitializer; |
15 using media::AudioDeviceNames; | 15 |
| 16 namespace media { |
16 | 17 |
17 class AudioInputVolumeTest : public ::testing::Test { | 18 class AudioInputVolumeTest : public ::testing::Test { |
18 protected: | 19 protected: |
19 AudioInputVolumeTest() | 20 AudioInputVolumeTest() |
20 : audio_manager_(AudioManager::Create()), | 21 : audio_manager_(AudioManager::Create()), |
21 com_init_(ScopedCOMInitializer::kMTA) { | 22 com_init_(ScopedCOMInitializer::kMTA) { |
22 } | 23 } |
23 | 24 |
24 bool CanRunAudioTests() { | 25 bool CanRunAudioTests() { |
25 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 EXPECT_NEAR(current_volume, new_volume, 0.25 * max_volume); | 151 EXPECT_NEAR(current_volume, new_volume, 0.25 * max_volume); |
151 | 152 |
152 // Restores the volume to the original value. | 153 // Restores the volume to the original value. |
153 ais->SetVolume(original_volume); | 154 ais->SetVolume(original_volume); |
154 current_volume = ais->GetVolume(); | 155 current_volume = ais->GetVolume(); |
155 EXPECT_EQ(original_volume, current_volume); | 156 EXPECT_EQ(original_volume, current_volume); |
156 | 157 |
157 ais->Close(); | 158 ais->Close(); |
158 } | 159 } |
159 } | 160 } |
| 161 |
| 162 } // namespace media |
OLD | NEW |