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

Side by Side Diff: content/renderer/media/webrtc/webrtc_local_audio_track_adapter_unittest.cc

Issue 218763007: Update MediaStreamTrack::Stop to latest draft. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 8 months 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 | Annotate | Revision Log
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 "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" 5 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
6 #include "content/renderer/media/webrtc_local_audio_track.h" 6 #include "content/renderer/media/webrtc_local_audio_track.h"
7 #include "testing/gmock/include/gmock/gmock.h" 7 #include "testing/gmock/include/gmock/gmock.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h" 9 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
10 10
(...skipping 18 matching lines...) Expand all
29 } // namespace 29 } // namespace
30 30
31 class WebRtcLocalAudioTrackAdapterTest : public ::testing::Test { 31 class WebRtcLocalAudioTrackAdapterTest : public ::testing::Test {
32 public: 32 public:
33 WebRtcLocalAudioTrackAdapterTest() 33 WebRtcLocalAudioTrackAdapterTest()
34 : params_(media::AudioParameters::AUDIO_PCM_LOW_LATENCY, 34 : params_(media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
35 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480), 35 media::CHANNEL_LAYOUT_STEREO, 48000, 16, 480),
36 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)), 36 adapter_(WebRtcLocalAudioTrackAdapter::Create(std::string(), NULL)),
37 capturer_(WebRtcAudioCapturer::CreateCapturer( 37 capturer_(WebRtcAudioCapturer::CreateCapturer(
38 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "", ""), 38 -1, StreamDeviceInfo(MEDIA_DEVICE_AUDIO_CAPTURE, "", ""),
39 blink::WebMediaConstraints(), NULL)), 39 blink::WebMediaConstraints(), NULL, NULL)),
40 track_(new WebRtcLocalAudioTrack(adapter_, capturer_, NULL)) {} 40 track_(new WebRtcLocalAudioTrack(adapter_, capturer_, NULL)) {}
41 41
42 protected: 42 protected:
43 virtual void SetUp() OVERRIDE { 43 virtual void SetUp() OVERRIDE {
44 track_->OnSetFormat(params_); 44 track_->OnSetFormat(params_);
45 EXPECT_TRUE(track_->GetAudioAdapter()->enabled()); 45 EXPECT_TRUE(track_->GetAudioAdapter()->enabled());
46 } 46 }
47 47
48 media::AudioParameters params_; 48 media::AudioParameters params_;
49 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_; 49 scoped_refptr<WebRtcLocalAudioTrackAdapter> adapter_;
(...skipping 23 matching lines...) Expand all
73 73
74 // Remove the sink from the webrtc track. 74 // Remove the sink from the webrtc track.
75 webrtc_track->RemoveSink(sink.get()); 75 webrtc_track->RemoveSink(sink.get());
76 sink.reset(); 76 sink.reset();
77 77
78 // Verify that no more callback gets into the sink. 78 // Verify that no more callback gets into the sink.
79 track_->Capture(data.get(), base::TimeDelta(), 255, false, false); 79 track_->Capture(data.get(), base::TimeDelta(), 255, false, false);
80 } 80 }
81 81
82 } // namespace content 82 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/media_stream_remote_video_source.cc ('k') | content/renderer/media/webrtc_audio_capturer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698