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 "media/cast/net/cast_transport_impl.h" | 5 #include "media/cast/net/cast_transport_impl.h" |
6 | 6 |
7 #include <gtest/gtest.h> | 7 #include <gtest/gtest.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 ~CastTransportImplTest() override {} | 99 ~CastTransportImplTest() override {} |
100 | 100 |
101 void InitWithoutLogging(); | 101 void InitWithoutLogging(); |
102 void InitWithOptions(); | 102 void InitWithOptions(); |
103 void InitWithLogging(); | 103 void InitWithLogging(); |
104 | 104 |
105 void InitializeVideo() { | 105 void InitializeVideo() { |
106 CastTransportRtpConfig rtp_config; | 106 CastTransportRtpConfig rtp_config; |
107 rtp_config.ssrc = kVideoSsrc; | 107 rtp_config.ssrc = kVideoSsrc; |
108 rtp_config.feedback_ssrc = 2; | 108 rtp_config.feedback_ssrc = 2; |
109 rtp_config.rtp_payload_type = 3; | 109 rtp_config.rtp_payload_type = RtpPayloadType::VIDEO_VP8; |
110 transport_sender_->InitializeVideo( | 110 transport_sender_->InitializeVideo( |
111 rtp_config, base::WrapUnique(new StubRtcpObserver())); | 111 rtp_config, base::WrapUnique(new StubRtcpObserver())); |
112 } | 112 } |
113 | 113 |
114 void InitializeAudio() { | 114 void InitializeAudio() { |
115 CastTransportRtpConfig rtp_config; | 115 CastTransportRtpConfig rtp_config; |
116 rtp_config.ssrc = kAudioSsrc; | 116 rtp_config.ssrc = kAudioSsrc; |
117 rtp_config.feedback_ssrc = 3; | 117 rtp_config.feedback_ssrc = 3; |
118 rtp_config.rtp_payload_type = 4; | 118 rtp_config.rtp_payload_type = RtpPayloadType::AUDIO_OPUS; |
119 transport_sender_->InitializeAudio( | 119 transport_sender_->InitializeAudio( |
120 rtp_config, base::WrapUnique(new StubRtcpObserver())); | 120 rtp_config, base::WrapUnique(new StubRtcpObserver())); |
121 } | 121 } |
122 | 122 |
123 base::SimpleTestTickClock testing_clock_; | 123 base::SimpleTestTickClock testing_clock_; |
124 scoped_refptr<FakeSingleThreadTaskRunner> task_runner_; | 124 scoped_refptr<FakeSingleThreadTaskRunner> task_runner_; |
125 std::unique_ptr<CastTransportImpl> transport_sender_; | 125 std::unique_ptr<CastTransportImpl> transport_sender_; |
126 FakePacketSender* transport_; // Owned by CastTransport. | 126 FakePacketSender* transport_; // Owned by CastTransport. |
127 int num_times_logging_callback_called_; | 127 int num_times_logging_callback_called_; |
128 }; | 128 }; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 task_runner_->RunTasks(); | 401 task_runner_->RunTasks(); |
402 EXPECT_EQ(7, transport_->packets_sent()); | 402 EXPECT_EQ(7, transport_->packets_sent()); |
403 EXPECT_EQ(1, num_times_logging_callback_called_); // Only 8 ms since last. | 403 EXPECT_EQ(1, num_times_logging_callback_called_); // Only 8 ms since last. |
404 | 404 |
405 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); | 405 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); |
406 EXPECT_EQ(2, num_times_logging_callback_called_); | 406 EXPECT_EQ(2, num_times_logging_callback_called_); |
407 } | 407 } |
408 | 408 |
409 } // namespace cast | 409 } // namespace cast |
410 } // namespace media | 410 } // namespace media |
OLD | NEW |