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

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

Issue 1853793002: Prepare to remove webrtc::MediaStreamTrackInterface::set_state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 int NumberOfSuccessConstraintsCallbacks() const { 83 int NumberOfSuccessConstraintsCallbacks() const {
84 return number_of_successful_constraints_applied_; 84 return number_of_successful_constraints_applied_;
85 } 85 }
86 86
87 int NumberOfFailedConstraintsCallbacks() const { 87 int NumberOfFailedConstraintsCallbacks() const {
88 return number_of_failed_constraints_applied_; 88 return number_of_failed_constraints_applied_;
89 } 89 }
90 90
91 void StopWebRtcTrack() { 91 void StopWebRtcTrack() {
92 static_cast<MockWebRtcVideoTrack*>(webrtc_video_track_.get())->set_state( 92 static_cast<MockWebRtcVideoTrack*>(webrtc_video_track_.get())->SetEnded();
93 webrtc::MediaStreamTrackInterface::kEnded);
94 } 93 }
95 94
96 const blink::WebMediaStreamSource& webkit_source() const { 95 const blink::WebMediaStreamSource& webkit_source() const {
97 return webkit_source_; 96 return webkit_source_;
98 } 97 }
99 98
100 private: 99 private:
101 void OnConstraintsApplied(MediaStreamSource* source, 100 void OnConstraintsApplied(MediaStreamSource* source,
102 MediaStreamRequestResult result, 101 MediaStreamRequestResult result,
103 const blink::WebString& result_name) { 102 const blink::WebString& result_name) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 StopWebRtcTrack(); 148 StopWebRtcTrack();
150 base::RunLoop().RunUntilIdle(); 149 base::RunLoop().RunUntilIdle();
151 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, 150 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded,
152 webkit_source().getReadyState()); 151 webkit_source().getReadyState());
153 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink.state()); 152 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink.state());
154 153
155 track->RemoveSink(&sink); 154 track->RemoveSink(&sink);
156 } 155 }
157 156
158 } // namespace content 157 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698