| 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 "content/renderer/media/webrtc_audio_renderer.h" | 5 #include "content/renderer/media/webrtc_audio_renderer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 device_id, device_id == kInvalidOutputDeviceId | 109 device_id, device_id == kInvalidOutputDeviceId |
| 110 ? media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL | 110 ? media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL |
| 111 : media::OUTPUT_DEVICE_STATUS_OK, | 111 : media::OUTPUT_DEVICE_STATUS_OK, |
| 112 media::AudioParameters( | 112 media::AudioParameters( |
| 113 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 113 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| 114 media::CHANNEL_LAYOUT_STEREO, kHardwareSampleRate, 16, | 114 media::CHANNEL_LAYOUT_STEREO, kHardwareSampleRate, 16, |
| 115 kHardwareBufferSize))); | 115 kHardwareBufferSize))); |
| 116 if (device_id != kInvalidOutputDeviceId) { | 116 if (device_id != kInvalidOutputDeviceId) { |
| 117 mock_sink_ = fake_sink; | 117 mock_sink_ = fake_sink; |
| 118 EXPECT_CALL(*mock_sink_.get(), Start()); | 118 EXPECT_CALL(*mock_sink_.get(), Start()); |
| 119 EXPECT_CALL(*mock_sink_.get(), Play()); |
| 119 } | 120 } |
| 120 | 121 |
| 121 MockCreateAudioRendererSink(source_type, render_frame_id, session_id, | 122 MockCreateAudioRendererSink(source_type, render_frame_id, session_id, |
| 122 device_id, security_origin); | 123 device_id, security_origin); |
| 123 return fake_sink; | 124 return fake_sink; |
| 124 } | 125 } |
| 125 | 126 |
| 126 void TearDown() override { | 127 void TearDown() override { |
| 127 renderer_proxy_ = nullptr; | 128 renderer_proxy_ = nullptr; |
| 128 renderer_ = nullptr; | 129 renderer_ = nullptr; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 loop.Run(); | 273 loop.Run(); |
| 273 EXPECT_EQ(kDefaultOutputDeviceId, | 274 EXPECT_EQ(kDefaultOutputDeviceId, |
| 274 mock_sink_->GetOutputDeviceInfo().device_id()); | 275 mock_sink_->GetOutputDeviceInfo().device_id()); |
| 275 | 276 |
| 276 EXPECT_CALL(*mock_sink_.get(), Stop()); | 277 EXPECT_CALL(*mock_sink_.get(), Stop()); |
| 277 EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); | 278 EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); |
| 278 renderer_proxy_->Stop(); | 279 renderer_proxy_->Stop(); |
| 279 } | 280 } |
| 280 | 281 |
| 281 } // namespace content | 282 } // namespace content |
| OLD | NEW |