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

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

Issue 2902733003: RemoteMediaStreamImpl using WebRtcMediaStreamTrackMap. (Closed)
Patch Set: "Must be invoked on the main thread." Created 3 years, 6 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
« no previous file with comments | « content/renderer/media/webrtc/webrtc_media_stream_track_adapter_map.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 (c) 2017 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2017 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_media_stream_track_adapter_map.h" 5 #include "content/renderer/media/webrtc/webrtc_media_stream_track_adapter_map.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "content/child/child_process.h" 13 #include "content/child/child_process.h"
14 #include "content/renderer/media/media_stream_audio_source.h" 14 #include "content/renderer/media/media_stream_audio_source.h"
15 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory. h" 15 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory. h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" 17 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
18 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 18 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
19 #include "third_party/WebKit/public/platform/WebString.h" 19 #include "third_party/WebKit/public/platform/WebString.h"
20 #include "third_party/WebKit/public/web/WebHeap.h" 20 #include "third_party/WebKit/public/web/WebHeap.h"
21 21
22 namespace content { 22 namespace content {
23 23
24 class WebRtcMediaStreamTrackAdapterMapTest : public ::testing::Test { 24 class WebRtcMediaStreamTrackAdapterMapTest : public ::testing::Test {
25 public: 25 public:
26 void SetUp() override { 26 void SetUp() override {
27 dependency_factory_.reset(new MockPeerConnectionDependencyFactory()); 27 dependency_factory_.reset(new MockPeerConnectionDependencyFactory());
28 main_thread_ = base::ThreadTaskRunnerHandle::Get(); 28 main_thread_ = base::ThreadTaskRunnerHandle::Get();
29 map_ = new WebRtcMediaStreamTrackAdapterMap(dependency_factory_.get(), 29 map_ = new WebRtcMediaStreamTrackAdapterMap(dependency_factory_.get());
30 main_thread_);
31 } 30 }
32 31
33 void TearDown() override { blink::WebHeap::CollectAllGarbageForTesting(); } 32 void TearDown() override { blink::WebHeap::CollectAllGarbageForTesting(); }
34 33
35 blink::WebMediaStreamTrack CreateLocalTrack(const std::string& id) { 34 blink::WebMediaStreamTrack CreateLocalTrack(const std::string& id) {
36 blink::WebMediaStreamSource web_source; 35 blink::WebMediaStreamSource web_source;
37 web_source.Initialize( 36 web_source.Initialize(
38 blink::WebString::FromUTF8(id), blink::WebMediaStreamSource::kTypeAudio, 37 blink::WebString::FromUTF8(id), blink::WebMediaStreamSource::kTypeAudio,
39 blink::WebString::FromUTF8("local_audio_track"), false); 38 blink::WebString::FromUTF8("local_audio_track"), false);
40 MediaStreamAudioSource* audio_source = new MediaStreamAudioSource(true); 39 MediaStreamAudioSource* audio_source = new MediaStreamAudioSource(true);
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 200
202 TEST_F(WebRtcMediaStreamTrackAdapterMapTest, GetLocalTrackAdapterInvalidID) { 201 TEST_F(WebRtcMediaStreamTrackAdapterMapTest, GetLocalTrackAdapterInvalidID) {
203 EXPECT_EQ(nullptr, map_->GetLocalTrackAdapter("invalid")); 202 EXPECT_EQ(nullptr, map_->GetLocalTrackAdapter("invalid"));
204 } 203 }
205 204
206 TEST_F(WebRtcMediaStreamTrackAdapterMapTest, GetRemoteTrackAdapterInvalidID) { 205 TEST_F(WebRtcMediaStreamTrackAdapterMapTest, GetRemoteTrackAdapterInvalidID) {
207 EXPECT_EQ(nullptr, map_->GetRemoteTrackAdapter("invalid")); 206 EXPECT_EQ(nullptr, map_->GetRemoteTrackAdapter("invalid"));
208 } 207 }
209 208
210 } // namespace content 209 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/webrtc_media_stream_track_adapter_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698