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