OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromeos/audio/audio_devices_pref_handler_impl.h" | 5 #include "chromeos/audio/audio_devices_pref_handler_impl.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 9 #include "base/macros.h" |
7 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
8 #include "base/prefs/testing_pref_service.h" | 11 #include "base/prefs/testing_pref_service.h" |
9 #include "chromeos/audio/audio_device.h" | 12 #include "chromeos/audio/audio_device.h" |
10 #include "chromeos/audio/audio_devices_pref_handler.h" | 13 #include "chromeos/audio/audio_devices_pref_handler.h" |
11 #include "chromeos/chromeos_pref_names.h" | 14 #include "chromeos/chromeos_pref_names.h" |
12 #include "chromeos/dbus/audio_node.h" | 15 #include "chromeos/dbus/audio_node.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
14 | 17 |
15 namespace chromeos { | 18 namespace chromeos { |
16 | 19 |
17 const uint64 kInternalMicId = 10003; | 20 const uint64_t kInternalMicId = 10003; |
18 const uint64 kHeadphoneId = 10002; | 21 const uint64_t kHeadphoneId = 10002; |
19 const uint64 kHDMIOutputId = 10006; | 22 const uint64_t kHDMIOutputId = 10006; |
20 const uint64 kOtherTypeOutputId = 90001; | 23 const uint64_t kOtherTypeOutputId = 90001; |
21 const uint64 kOtherTypeInputId = 90002; | 24 const uint64_t kOtherTypeInputId = 90002; |
22 | 25 |
23 const AudioDevice kInternalMic(AudioNode(true, | 26 const AudioDevice kInternalMic(AudioNode(true, |
24 kInternalMicId, | 27 kInternalMicId, |
25 "Fake Mic", | 28 "Fake Mic", |
26 "INTERNAL_MIC", | 29 "INTERNAL_MIC", |
27 "Internal Mic", | 30 "Internal Mic", |
28 false, | 31 false, |
29 0)); | 32 0)); |
30 | 33 |
31 const AudioDevice kHeadphone(AudioNode(false, | 34 const AudioDevice kHeadphone(AudioNode(false, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 audio_pref_handler_->SetVolumeGainValue(kOutputDeviceWithSpecialCharacters, | 116 audio_pref_handler_->SetVolumeGainValue(kOutputDeviceWithSpecialCharacters, |
114 85.92); | 117 85.92); |
115 | 118 |
116 EXPECT_EQ(73.31, audio_pref_handler_->GetInputGainValue( | 119 EXPECT_EQ(73.31, audio_pref_handler_->GetInputGainValue( |
117 &kInputDeviceWithSpecialCharacters)); | 120 &kInputDeviceWithSpecialCharacters)); |
118 EXPECT_EQ(85.92, audio_pref_handler_->GetOutputVolumeValue( | 121 EXPECT_EQ(85.92, audio_pref_handler_->GetOutputVolumeValue( |
119 &kOutputDeviceWithSpecialCharacters)); | 122 &kOutputDeviceWithSpecialCharacters)); |
120 } | 123 } |
121 | 124 |
122 } // namespace chromeos | 125 } // namespace chromeos |
OLD | NEW |