OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/test/simple_test_tick_clock.h" | 9 #include "base/test/simple_test_tick_clock.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 EXPECT_CALL(mock_transport_, SendPackets(_)).Times(1); | 122 EXPECT_CALL(mock_transport_, SendPackets(_)).Times(1); |
123 InitEncoder(true); | 123 InitEncoder(true); |
124 task_runner_->RunTasks(); | 124 task_runner_->RunTasks(); |
125 | 125 |
126 scoped_refptr<media::VideoFrame> video_frame = GetNewVideoFrame(); | 126 scoped_refptr<media::VideoFrame> video_frame = GetNewVideoFrame(); |
127 | 127 |
128 base::TimeTicks capture_time; | 128 base::TimeTicks capture_time; |
129 video_sender_->InsertRawVideoFrame(video_frame, capture_time); | 129 video_sender_->InsertRawVideoFrame(video_frame, capture_time); |
130 | 130 |
131 task_runner_->RunTasks(); | 131 task_runner_->RunTasks(); |
| 132 |
| 133 // We need to run the task to cleanup the GPU instance. |
| 134 video_sender_.reset(NULL); |
| 135 task_runner_->RunTasks(); |
132 } | 136 } |
133 | 137 |
134 TEST_F(VideoSenderTest, RtcpTimer) { | 138 TEST_F(VideoSenderTest, RtcpTimer) { |
135 EXPECT_CALL(mock_transport_, SendPackets(_)).Times(AtLeast(1)); | 139 EXPECT_CALL(mock_transport_, SendPackets(_)).Times(AtLeast(1)); |
136 EXPECT_CALL(mock_transport_, SendRtcpPacket(_)).Times(1); | 140 EXPECT_CALL(mock_transport_, SendRtcpPacket(_)).Times(1); |
137 InitEncoder(false); | 141 InitEncoder(false); |
138 | 142 |
139 scoped_refptr<media::VideoFrame> video_frame = GetNewVideoFrame(); | 143 scoped_refptr<media::VideoFrame> video_frame = GetNewVideoFrame(); |
140 | 144 |
141 base::TimeTicks capture_time; | 145 base::TimeTicks capture_time; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 base::TimeDelta::FromMilliseconds(1 + kDefaultRtpMaxDelayMs); | 182 base::TimeDelta::FromMilliseconds(1 + kDefaultRtpMaxDelayMs); |
179 | 183 |
180 // Make sure that we do a re-send. | 184 // Make sure that we do a re-send. |
181 testing_clock_.Advance(max_resend_timeout); | 185 testing_clock_.Advance(max_resend_timeout); |
182 task_runner_->RunTasks(); | 186 task_runner_->RunTasks(); |
183 } | 187 } |
184 | 188 |
185 } // namespace cast | 189 } // namespace cast |
186 } // namespace media | 190 } // namespace media |
187 | 191 |
OLD | NEW |