| 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "content/child/child_process.h" | 8 #include "content/child/child_process.h" |
| 9 #include "content/renderer/media/media_stream_video_track.h" | 9 #include "content/renderer/media/media_stream_video_track.h" |
| 10 #include "content/renderer/media/mock_media_stream_video_sink.h" | 10 #include "content/renderer/media/mock_media_stream_video_sink.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 void OnConstraintsApplied(MediaStreamSource* source, bool success) { | 87 void OnConstraintsApplied(MediaStreamSource* source, bool success) { |
| 88 ASSERT_EQ(source, remote_source_); | 88 ASSERT_EQ(source, remote_source_); |
| 89 if (success) | 89 if (success) |
| 90 ++number_of_successful_constraints_applied_; | 90 ++number_of_successful_constraints_applied_; |
| 91 else | 91 else |
| 92 ++number_of_failed_constraints_applied_; | 92 ++number_of_failed_constraints_applied_; |
| 93 } | 93 } |
| 94 | 94 |
| 95 base::MessageLoopForUI message_loop_; |
| 95 scoped_ptr<ChildProcess> child_process_; | 96 scoped_ptr<ChildProcess> child_process_; |
| 96 base::MessageLoopForUI message_loop_; | |
| 97 scoped_ptr<MockPeerConnectionDependencyFactory> mock_factory_; | 97 scoped_ptr<MockPeerConnectionDependencyFactory> mock_factory_; |
| 98 scoped_refptr<webrtc::VideoTrackInterface> webrtc_video_track_; | 98 scoped_refptr<webrtc::VideoTrackInterface> webrtc_video_track_; |
| 99 // |remote_source_| is owned by |webkit_source_|. | 99 // |remote_source_| is owned by |webkit_source_|. |
| 100 MediaStreamRemoteVideoSourceUnderTest* remote_source_; | 100 MediaStreamRemoteVideoSourceUnderTest* remote_source_; |
| 101 blink::WebMediaStreamSource webkit_source_; | 101 blink::WebMediaStreamSource webkit_source_; |
| 102 int number_of_successful_constraints_applied_; | 102 int number_of_successful_constraints_applied_; |
| 103 int number_of_failed_constraints_applied_; | 103 int number_of_failed_constraints_applied_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 TEST_F(MediaStreamRemoteVideoSourceTest, StartTrack) { | 106 TEST_F(MediaStreamRemoteVideoSourceTest, StartTrack) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 132 webkit_source().readyState()); | 132 webkit_source().readyState()); |
| 133 StopWebRtcTrack(); | 133 StopWebRtcTrack(); |
| 134 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, | 134 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, |
| 135 webkit_source().readyState()); | 135 webkit_source().readyState()); |
| 136 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink.state()); | 136 EXPECT_EQ(blink::WebMediaStreamSource::ReadyStateEnded, sink.state()); |
| 137 | 137 |
| 138 track->RemoveSink(&sink); | 138 track->RemoveSink(&sink); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace content | 141 } // namespace content |
| OLD | NEW |