| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/cras_audio_handler.h" | 5 #include "chromeos/audio/cras_audio_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 uint64_t stable_device_id_v1 = node_info->id; | 234 uint64_t stable_device_id_v1 = node_info->id; |
| 235 return AudioNode(node_info->is_input, node_info->id, GetParam() == 2, | 235 return AudioNode(node_info->is_input, node_info->id, GetParam() == 2, |
| 236 stable_device_id_v1, stable_device_id_v2, | 236 stable_device_id_v1, stable_device_id_v2, |
| 237 node_info->device_name, node_info->type, node_info->name, | 237 node_info->device_name, node_info->type, node_info->name, |
| 238 false /* is_active*/, 0 /* pluged_time */); | 238 false /* is_active*/, 0 /* pluged_time */); |
| 239 } | 239 } |
| 240 | 240 |
| 241 AudioNodeList GenerateAudioNodeList( | 241 AudioNodeList GenerateAudioNodeList( |
| 242 const std::vector<const AudioNodeInfo*> nodes) { | 242 const std::vector<const AudioNodeInfo*> nodes) { |
| 243 AudioNodeList node_list; | 243 AudioNodeList node_list; |
| 244 for (auto node_info : nodes) { | 244 for (auto* node_info : nodes) { |
| 245 node_list.push_back(GenerateAudioNode(node_info)); | 245 node_list.push_back(GenerateAudioNode(node_info)); |
| 246 } | 246 } |
| 247 return node_list; | 247 return node_list; |
| 248 } | 248 } |
| 249 | 249 |
| 250 void SetUpCrasAudioHandler(const AudioNodeList& audio_nodes) { | 250 void SetUpCrasAudioHandler(const AudioNodeList& audio_nodes) { |
| 251 DBusThreadManager::Initialize(); | 251 DBusThreadManager::Initialize(); |
| 252 fake_cras_audio_client_ = static_cast<FakeCrasAudioClient*>( | 252 fake_cras_audio_client_ = static_cast<FakeCrasAudioClient*>( |
| 253 DBusThreadManager::Get()->GetCrasAudioClient()); | 253 DBusThreadManager::Get()->GetCrasAudioClient()); |
| 254 fake_cras_audio_client_->SetAudioNodesForTesting(audio_nodes); | 254 fake_cras_audio_client_->SetAudioNodesForTesting(audio_nodes); |
| (...skipping 3419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3674 cras_audio_handler_->GetPrimaryActiveOutputDevice(&active_output)); | 3674 cras_audio_handler_->GetPrimaryActiveOutputDevice(&active_output)); |
| 3675 EXPECT_EQ(kInternalSpeaker->id, active_output.id); | 3675 EXPECT_EQ(kInternalSpeaker->id, active_output.id); |
| 3676 EXPECT_EQ(kInternalSpeaker->id, | 3676 EXPECT_EQ(kInternalSpeaker->id, |
| 3677 cras_audio_handler_->GetPrimaryActiveOutputNode()); | 3677 cras_audio_handler_->GetPrimaryActiveOutputNode()); |
| 3678 EXPECT_FALSE(cras_audio_handler_->IsOutputMuted()); | 3678 EXPECT_FALSE(cras_audio_handler_->IsOutputMuted()); |
| 3679 EXPECT_EQ(1, test_observer_->output_mute_changed_count()); | 3679 EXPECT_EQ(1, test_observer_->output_mute_changed_count()); |
| 3680 EXPECT_TRUE(test_observer_->output_mute_by_system()); | 3680 EXPECT_TRUE(test_observer_->output_mute_by_system()); |
| 3681 } | 3681 } |
| 3682 | 3682 |
| 3683 } // namespace chromeos | 3683 } // namespace chromeos |
| OLD | NEW |