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/media_stream_remote_video_source.h" | 5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 mock_factory_(new MockPeerConnectionDependencyFactory()), | 42 mock_factory_(new MockPeerConnectionDependencyFactory()), |
43 webrtc_video_track_(MockWebRtcVideoTrack::Create("test")), | 43 webrtc_video_track_(MockWebRtcVideoTrack::Create("test")), |
44 remote_source_(new MediaStreamRemoteVideoSourceUnderTest( | 44 remote_source_(new MediaStreamRemoteVideoSourceUnderTest( |
45 std::unique_ptr<TrackObserver>( | 45 std::unique_ptr<TrackObserver>( |
46 new TrackObserver(base::ThreadTaskRunnerHandle::Get(), | 46 new TrackObserver(base::ThreadTaskRunnerHandle::Get(), |
47 webrtc_video_track_.get())))), | 47 webrtc_video_track_.get())))), |
48 number_of_successful_constraints_applied_(0), | 48 number_of_successful_constraints_applied_(0), |
49 number_of_failed_constraints_applied_(0) { | 49 number_of_failed_constraints_applied_(0) { |
50 webkit_source_.initialize(blink::WebString::fromASCII("dummy_source_id"), | 50 webkit_source_.initialize(blink::WebString::fromASCII("dummy_source_id"), |
51 blink::WebMediaStreamSource::TypeVideo, | 51 blink::WebMediaStreamSource::TypeVideo, |
52 blink::WebString::fromASCII("dummy_source_name")); | 52 blink::WebString::fromASCII("dummy_source_name"), |
| 53 true /* remote */); |
53 webkit_source_.setExtraData(remote_source_); | 54 webkit_source_.setExtraData(remote_source_); |
54 } | 55 } |
55 | 56 |
56 void TearDown() override { | 57 void TearDown() override { |
57 remote_source_->OnSourceTerminated(); | 58 remote_source_->OnSourceTerminated(); |
58 webkit_source_.reset(); | 59 webkit_source_.reset(); |
59 blink::WebHeap::collectAllGarbageForTesting(); | 60 blink::WebHeap::collectAllGarbageForTesting(); |
60 } | 61 } |
61 | 62 |
62 MediaStreamRemoteVideoSourceUnderTest* source() { | 63 MediaStreamRemoteVideoSourceUnderTest* source() { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 StopWebRtcTrack(); | 149 StopWebRtcTrack(); |
149 base::RunLoop().RunUntilIdle(); | 150 base::RunLoop().RunUntilIdle(); |
150 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, | 151 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, |
151 webkit_source().getReadyState()); | 152 webkit_source().getReadyState()); |
152 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink.state()); | 153 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink.state()); |
153 | 154 |
154 track->RemoveSink(&sink); | 155 track->RemoveSink(&sink); |
155 } | 156 } |
156 | 157 |
157 } // namespace content | 158 } // namespace content |
OLD | NEW |