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: media/cast/net/cast_transport_sender_impl_unittest.cc

Issue 1709863002: Add Cast PLI support on sender side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 "media/cast/net/cast_transport_sender_impl.h" 5 #include "media/cast/net/cast_transport_sender_impl.h"
6 6
7 #include <gtest/gtest.h> 7 #include <gtest/gtest.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 void InitWithoutLogging(); 89 void InitWithoutLogging();
90 void InitWithOptions(); 90 void InitWithOptions();
91 void InitWithLogging(); 91 void InitWithLogging();
92 92
93 void InitializeVideo() { 93 void InitializeVideo() {
94 CastTransportRtpConfig rtp_config; 94 CastTransportRtpConfig rtp_config;
95 rtp_config.ssrc = kVideoSsrc; 95 rtp_config.ssrc = kVideoSsrc;
96 rtp_config.feedback_ssrc = 2; 96 rtp_config.feedback_ssrc = 2;
97 rtp_config.rtp_payload_type = 3; 97 rtp_config.rtp_payload_type = 3;
98 transport_sender_->InitializeVideo(rtp_config, RtcpCastMessageCallback(), 98 transport_sender_->InitializeVideo(rtp_config, RtcpCastMessageCallback(),
99 RtcpRttCallback()); 99 RtcpRttCallback(), RtcpPliCallback());
100 } 100 }
101 101
102 void InitializeAudio() { 102 void InitializeAudio() {
103 CastTransportRtpConfig rtp_config; 103 CastTransportRtpConfig rtp_config;
104 rtp_config.ssrc = kAudioSsrc; 104 rtp_config.ssrc = kAudioSsrc;
105 rtp_config.feedback_ssrc = 3; 105 rtp_config.feedback_ssrc = 3;
106 rtp_config.rtp_payload_type = 4; 106 rtp_config.rtp_payload_type = 4;
107 transport_sender_->InitializeAudio(rtp_config, RtcpCastMessageCallback(), 107 transport_sender_->InitializeAudio(rtp_config, RtcpCastMessageCallback(),
108 RtcpRttCallback()); 108 RtcpRttCallback(), RtcpPliCallback());
109 } 109 }
110 110
111 base::SimpleTestTickClock testing_clock_; 111 base::SimpleTestTickClock testing_clock_;
112 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_; 112 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_;
113 scoped_ptr<CastTransportSenderImpl> transport_sender_; 113 scoped_ptr<CastTransportSenderImpl> transport_sender_;
114 FakePacketSender* transport_; // Owned by CastTransportSender. 114 FakePacketSender* transport_; // Owned by CastTransportSender.
115 int num_times_logging_callback_called_; 115 int num_times_logging_callback_called_;
116 }; 116 };
117 117
118 namespace { 118 namespace {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 task_runner_->RunTasks(); 395 task_runner_->RunTasks();
396 EXPECT_EQ(7, transport_->packets_sent()); 396 EXPECT_EQ(7, transport_->packets_sent());
397 EXPECT_EQ(1, num_times_logging_callback_called_); // Only 8 ms since last. 397 EXPECT_EQ(1, num_times_logging_callback_called_); // Only 8 ms since last.
398 398
399 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); 399 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2));
400 EXPECT_EQ(2, num_times_logging_callback_called_); 400 EXPECT_EQ(2, num_times_logging_callback_called_);
401 } 401 }
402 402
403 } // namespace cast 403 } // namespace cast
404 } // namespace media 404 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698