| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/test/simple_test_tick_clock.h" | 10 #include "base/test/simple_test_tick_clock.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 audio_config_.frequency = kDefaultAudioSamplingRate; | 70 audio_config_.frequency = kDefaultAudioSamplingRate; |
| 71 audio_config_.channels = 2; | 71 audio_config_.channels = 2; |
| 72 audio_config_.bitrate = kDefaultAudioEncoderBitrate; | 72 audio_config_.bitrate = kDefaultAudioEncoderBitrate; |
| 73 audio_config_.rtp_payload_type = 127; | 73 audio_config_.rtp_payload_type = 127; |
| 74 | 74 |
| 75 net::IPEndPoint dummy_endpoint; | 75 net::IPEndPoint dummy_endpoint; |
| 76 | 76 |
| 77 transport_sender_.reset(new CastTransportSenderImpl( | 77 transport_sender_.reset(new CastTransportSenderImpl( |
| 78 NULL, | 78 NULL, |
| 79 testing_clock_, | 79 testing_clock_, |
| 80 net::IPEndPoint(), |
| 80 dummy_endpoint, | 81 dummy_endpoint, |
| 81 make_scoped_ptr(new base::DictionaryValue), | 82 make_scoped_ptr(new base::DictionaryValue), |
| 82 base::Bind(&UpdateCastTransportStatus), | 83 base::Bind(&UpdateCastTransportStatus), |
| 83 BulkRawEventsCallback(), | 84 BulkRawEventsCallback(), |
| 84 base::TimeDelta(), | 85 base::TimeDelta(), |
| 85 task_runner_, | 86 task_runner_, |
| 87 PacketReceiverCallback(), |
| 86 &transport_)); | 88 &transport_)); |
| 87 audio_sender_.reset(new AudioSender( | 89 audio_sender_.reset(new AudioSender( |
| 88 cast_environment_, audio_config_, transport_sender_.get())); | 90 cast_environment_, audio_config_, transport_sender_.get())); |
| 89 task_runner_->RunTasks(); | 91 task_runner_->RunTasks(); |
| 90 } | 92 } |
| 91 | 93 |
| 92 ~AudioSenderTest() override {} | 94 ~AudioSenderTest() override {} |
| 93 | 95 |
| 94 static void UpdateCastTransportStatus(CastTransportStatus status) { | 96 static void UpdateCastTransportStatus(CastTransportStatus status) { |
| 95 EXPECT_EQ(TRANSPORT_AUDIO_INITIALIZED, status); | 97 EXPECT_EQ(TRANSPORT_AUDIO_INITIALIZED, status); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 base::TimeDelta max_rtcp_timeout = | 135 base::TimeDelta max_rtcp_timeout = |
| 134 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); | 136 base::TimeDelta::FromMilliseconds(1 + kDefaultRtcpIntervalMs * 3 / 2); |
| 135 testing_clock_->Advance(max_rtcp_timeout); | 137 testing_clock_->Advance(max_rtcp_timeout); |
| 136 task_runner_->RunTasks(); | 138 task_runner_->RunTasks(); |
| 137 EXPECT_LE(1, transport_.number_of_rtp_packets()); | 139 EXPECT_LE(1, transport_.number_of_rtp_packets()); |
| 138 EXPECT_LE(1, transport_.number_of_rtcp_packets()); | 140 EXPECT_LE(1, transport_.number_of_rtcp_packets()); |
| 139 } | 141 } |
| 140 | 142 |
| 141 } // namespace cast | 143 } // namespace cast |
| 142 } // namespace media | 144 } // namespace media |
| OLD | NEW |