Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Side by Side Diff: content/renderer/media/webrtc_audio_renderer_unittest.cc

Issue 1528473003: Feed the WebRTC APM with empty far-end frames for the number of frames skipped by OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review. Rebase. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/media/webrtc_audio_renderer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698