| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "content/renderer/media/webrtc/media_stream_track_metrics.h" | 9 #include "content/renderer/media/webrtc/media_stream_track_metrics.h" |
| 10 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
h" | 10 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory.
h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 run_loop.Run(); | 125 run_loop.Run(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 // Convenience methods to cast the mock track types into their webrtc | 128 // Convenience methods to cast the mock track types into their webrtc |
| 129 // equivalents. | 129 // equivalents. |
| 130 void AddAudioTrack(AudioTrackInterface* track) { AddTrack(track); } | 130 void AddAudioTrack(AudioTrackInterface* track) { AddTrack(track); } |
| 131 void RemoveAudioTrack(AudioTrackInterface* track) { RemoveTrack(track); } | 131 void RemoveAudioTrack(AudioTrackInterface* track) { RemoveTrack(track); } |
| 132 void AddVideoTrack(VideoTrackInterface* track) { AddTrack(track); } | 132 void AddVideoTrack(VideoTrackInterface* track) { AddTrack(track); } |
| 133 void RemoveVideoTrack(VideoTrackInterface* track) { RemoveTrack(track); } | 133 void RemoveVideoTrack(VideoTrackInterface* track) { RemoveTrack(track); } |
| 134 | 134 |
| 135 scoped_refptr<MockAudioTrackInterface> MakeAudioTrack(std::string id) { | 135 scoped_refptr<MockAudioTrackInterface> MakeAudioTrack(const std::string& id) { |
| 136 return new rtc::RefCountedObject<MockAudioTrackInterface>(id); | 136 return new rtc::RefCountedObject<MockAudioTrackInterface>(id); |
| 137 } | 137 } |
| 138 | 138 |
| 139 scoped_refptr<MockVideoTrackInterface> MakeVideoTrack(std::string id) { | 139 scoped_refptr<MockVideoTrackInterface> MakeVideoTrack(const std::string& id) { |
| 140 return new rtc::RefCountedObject<MockVideoTrackInterface>(id); | 140 return new rtc::RefCountedObject<MockVideoTrackInterface>(id); |
| 141 } | 141 } |
| 142 | 142 |
| 143 scoped_ptr<MockMediaStreamTrackMetrics> metrics_; | 143 scoped_ptr<MockMediaStreamTrackMetrics> metrics_; |
| 144 scoped_refptr<MediaStreamInterface> stream_; | 144 scoped_refptr<MediaStreamInterface> stream_; |
| 145 | 145 |
| 146 base::MessageLoopForUI message_loop_; | 146 base::MessageLoopForUI message_loop_; |
| 147 base::Thread signaling_thread_; | 147 base::Thread signaling_thread_; |
| 148 }; | 148 }; |
| 149 | 149 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 MediaStreamTrackMetrics::SENT_STREAM)); | 581 MediaStreamTrackMetrics::SENT_STREAM)); |
| 582 EXPECT_CALL(*metrics_, | 582 EXPECT_CALL(*metrics_, |
| 583 SendLifetimeMessage("video3", | 583 SendLifetimeMessage("video3", |
| 584 MediaStreamTrackMetrics::VIDEO_TRACK, | 584 MediaStreamTrackMetrics::VIDEO_TRACK, |
| 585 MediaStreamTrackMetrics::DISCONNECTED, | 585 MediaStreamTrackMetrics::DISCONNECTED, |
| 586 MediaStreamTrackMetrics::SENT_STREAM)); | 586 MediaStreamTrackMetrics::SENT_STREAM)); |
| 587 metrics_->RemoveStream(MediaStreamTrackMetrics::SENT_STREAM, stream_.get()); | 587 metrics_->RemoveStream(MediaStreamTrackMetrics::SENT_STREAM, stream_.get()); |
| 588 } | 588 } |
| 589 | 589 |
| 590 } // namespace content | 590 } // namespace content |
| OLD | NEW |