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 "extensions/shell/browser/shell_audio_controller_chromeos.h" | 5 #include "extensions/shell/browser/shell_audio_controller_chromeos.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "chromeos/audio/audio_device.h" | 8 #include "chromeos/audio/audio_device.h" |
9 #include "chromeos/audio/audio_devices_pref_handler.h" | 9 #include "chromeos/audio/audio_devices_pref_handler.h" |
10 #include "chromeos/audio/cras_audio_handler.h" | 10 #include "chromeos/audio/cras_audio_handler.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 audio_client_ = new chromeos::FakeCrasAudioClient(); | 29 audio_client_ = new chromeos::FakeCrasAudioClient(); |
30 audio_client_->SetAudioNodesForTesting(AudioNodeList()); | 30 audio_client_->SetAudioNodesForTesting(AudioNodeList()); |
31 dbus_setter->SetCrasAudioClient(make_scoped_ptr(audio_client_)); | 31 dbus_setter->SetCrasAudioClient(make_scoped_ptr(audio_client_)); |
32 | 32 |
33 chromeos::CrasAudioHandler::InitializeForTesting(); | 33 chromeos::CrasAudioHandler::InitializeForTesting(); |
34 audio_handler_ = chromeos::CrasAudioHandler::Get(); | 34 audio_handler_ = chromeos::CrasAudioHandler::Get(); |
35 | 35 |
36 controller_.reset(new ShellAudioController()); | 36 controller_.reset(new ShellAudioController()); |
37 } | 37 } |
38 | 38 |
39 virtual ~ShellAudioControllerTest() { | 39 ~ShellAudioControllerTest() override { |
40 controller_.reset(); | 40 controller_.reset(); |
41 chromeos::CrasAudioHandler::Shutdown(); | 41 chromeos::CrasAudioHandler::Shutdown(); |
42 chromeos::DBusThreadManager::Shutdown(); | 42 chromeos::DBusThreadManager::Shutdown(); |
43 } | 43 } |
44 | 44 |
45 protected: | 45 protected: |
46 // Fills a AudioNode for use by tests. | 46 // Fills a AudioNode for use by tests. |
47 AudioNode CreateNode(chromeos::AudioDeviceType type) { | 47 AudioNode CreateNode(chromeos::AudioDeviceType type) { |
48 AudioNode node; | 48 AudioNode node; |
49 node.is_input = | 49 node.is_input = |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 EXPECT_FALSE(audio_handler_->IsInputMuted()); | 128 EXPECT_FALSE(audio_handler_->IsInputMuted()); |
129 EXPECT_EQ(static_cast<double>( | 129 EXPECT_EQ(static_cast<double>( |
130 chromeos::AudioDevicesPrefHandler::kDefaultOutputVolumePercent), | 130 chromeos::AudioDevicesPrefHandler::kDefaultOutputVolumePercent), |
131 audio_handler_->GetOutputVolumePercent()); | 131 audio_handler_->GetOutputVolumePercent()); |
132 | 132 |
133 // TODO(rkc): The default value for gain is wrong. http://crbug.com/442489 | 133 // TODO(rkc): The default value for gain is wrong. http://crbug.com/442489 |
134 EXPECT_EQ(75.0, audio_handler_->GetInputGainPercent()); | 134 EXPECT_EQ(75.0, audio_handler_->GetInputGainPercent()); |
135 } | 135 } |
136 | 136 |
137 } // namespace extensions | 137 } // namespace extensions |
OLD | NEW |