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

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

Issue 2710213005: Revert of Remove |remote| and |readonly| members of MediaStreamTrack (Closed)
Patch Set: Created 3 years, 10 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
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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698