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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 | 306 |
307 RtcpCastMessage cast_feedback(1); | 307 RtcpCastMessage cast_feedback(1); |
308 cast_feedback.ack_frame_id_ = num_frames - 1; | 308 cast_feedback.ack_frame_id_ = num_frames - 1; |
309 | 309 |
310 video_sender_->OnReceivedCastFeedback(cast_feedback); | 310 video_sender_->OnReceivedCastFeedback(cast_feedback); |
311 | 311 |
312 std::vector<FrameEvent> frame_events; | 312 std::vector<FrameEvent> frame_events; |
313 event_subscriber.GetFrameEventsAndReset(&frame_events); | 313 event_subscriber.GetFrameEventsAndReset(&frame_events); |
314 | 314 |
315 ASSERT_TRUE(!frame_events.empty()); | 315 ASSERT_TRUE(!frame_events.empty()); |
316 EXPECT_EQ(kVideoAckReceived, frame_events.rbegin()->type); | 316 EXPECT_EQ(FRAME_ACK_RECEIVED, frame_events.rbegin()->type); |
| 317 EXPECT_EQ(VIDEO_EVENT, frame_events.rbegin()->media_type); |
317 EXPECT_EQ(num_frames - 1u, frame_events.rbegin()->frame_id); | 318 EXPECT_EQ(num_frames - 1u, frame_events.rbegin()->frame_id); |
318 | 319 |
319 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); | 320 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); |
320 } | 321 } |
321 | 322 |
322 TEST_F(VideoSenderTest, StopSendingIntheAbsenceOfAck) { | 323 TEST_F(VideoSenderTest, StopSendingIntheAbsenceOfAck) { |
323 InitEncoder(false); | 324 InitEncoder(false); |
324 // Send a stream of frames and don't ACK; by default we shouldn't have more | 325 // Send a stream of frames and don't ACK; by default we shouldn't have more |
325 // than 4 frames in flight. | 326 // than 4 frames in flight. |
326 // Store size in packets of frame 0, as it should be resent sue to timeout. | 327 // Store size in packets of frame 0, as it should be resent sue to timeout. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 // Empty the pipeline. | 363 // Empty the pipeline. |
363 RunTasks(100); | 364 RunTasks(100); |
364 // Should have sent at least 7 packets. | 365 // Should have sent at least 7 packets. |
365 EXPECT_GE( | 366 EXPECT_GE( |
366 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), | 367 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), |
367 7); | 368 7); |
368 } | 369 } |
369 | 370 |
370 } // namespace cast | 371 } // namespace cast |
371 } // namespace media | 372 } // namespace media |
OLD | NEW |