| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "content/public/renderer/media_stream_audio_renderer.h" | 10 #include "content/public/renderer/media_stream_audio_renderer.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 virtual ~FakeAudioOutputDevice() {} | 96 virtual ~FakeAudioOutputDevice() {} |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 const std::string device_id_; | 99 const std::string device_id_; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 class MockAudioRendererSource : public WebRtcAudioRendererSource { | 102 class MockAudioRendererSource : public WebRtcAudioRendererSource { |
| 103 public: | 103 public: |
| 104 MockAudioRendererSource() {} | 104 MockAudioRendererSource() {} |
| 105 virtual ~MockAudioRendererSource() {} | 105 virtual ~MockAudioRendererSource() {} |
| 106 MOCK_METHOD4(RenderData, void(media::AudioBus* audio_bus, | 106 MOCK_METHOD5(RenderData, void(media::AudioBus* audio_bus, |
| 107 int sample_rate, | 107 int sample_rate, |
| 108 int audio_delay_milliseconds, | 108 int audio_delay_milliseconds, |
| 109 uint32_t skipped_frames, |
| 109 base::TimeDelta* current_time)); | 110 base::TimeDelta* current_time)); |
| 110 MOCK_METHOD1(RemoveAudioRenderer, void(WebRtcAudioRenderer* renderer)); | 111 MOCK_METHOD1(RemoveAudioRenderer, void(WebRtcAudioRenderer* renderer)); |
| 111 MOCK_METHOD0(AudioRendererThreadStopped, void()); | 112 MOCK_METHOD0(AudioRendererThreadStopped, void()); |
| 112 }; | 113 }; |
| 113 | 114 |
| 114 } // namespace | 115 } // namespace |
| 115 | 116 |
| 116 class WebRtcAudioRendererTest : public testing::Test, | 117 class WebRtcAudioRendererTest : public testing::Test, |
| 117 public AudioDeviceFactory { | 118 public AudioDeviceFactory { |
| 118 public: | 119 public: |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 base::Unretained(this), &loop)); | 310 base::Unretained(this), &loop)); |
| 310 loop.Run(); | 311 loop.Run(); |
| 311 EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId()); | 312 EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId()); |
| 312 | 313 |
| 313 EXPECT_CALL(*mock_output_device_.get(), Stop()); | 314 EXPECT_CALL(*mock_output_device_.get(), Stop()); |
| 314 EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); | 315 EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get())); |
| 315 renderer_proxy_->Stop(); | 316 renderer_proxy_->Stop(); |
| 316 } | 317 } |
| 317 | 318 |
| 318 } // namespace content | 319 } // namespace content |
| OLD | NEW |