| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 testing_clock_ = new base::SimpleTestTickClock(); | 85 testing_clock_ = new base::SimpleTestTickClock(); |
| 86 testing_clock_->Advance( | 86 testing_clock_->Advance( |
| 87 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 87 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
| 88 task_runner_ = new test::FakeTaskRunner(testing_clock_); | 88 task_runner_ = new test::FakeTaskRunner(testing_clock_); |
| 89 cast_environment_ = new CastEnvironment( | 89 cast_environment_ = new CastEnvironment( |
| 90 scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 90 scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
| 91 task_runner_, task_runner_, task_runner_, task_runner_, | 91 task_runner_, task_runner_, task_runner_, task_runner_, |
| 92 task_runner_, task_runner_, GetDefaultCastSenderLoggingConfig()); | 92 task_runner_, task_runner_, GetDefaultCastSenderLoggingConfig()); |
| 93 transport::CastTransportConfig transport_config; | 93 transport::CastTransportConfig transport_config; |
| 94 transport_sender_.reset(new transport::CastTransportSenderImpl( | 94 transport_sender_.reset(new transport::CastTransportSenderImpl( |
| 95 testing_clock_, transport_config, | 95 testing_clock_, |
| 96 base::Bind(&UpdateCastTransportStatus), task_runner_)); | 96 transport_config, |
| 97 transport_sender_->InsertFakeTransportForTesting(&transport_); | 97 base::Bind(&UpdateCastTransportStatus), |
| 98 task_runner_, |
| 99 &transport_)); |
| 98 } | 100 } |
| 99 | 101 |
| 100 virtual ~VideoSenderTest() {} | 102 virtual ~VideoSenderTest() {} |
| 101 | 103 |
| 102 virtual void TearDown() OVERRIDE { | 104 virtual void TearDown() OVERRIDE { |
| 103 video_sender_.reset(); | 105 video_sender_.reset(); |
| 104 task_runner_->RunTasks(); | 106 task_runner_->RunTasks(); |
| 105 } | 107 } |
| 106 | 108 |
| 107 static void UpdateCastTransportStatus(transport::CastTransportStatus status) { | 109 static void UpdateCastTransportStatus(transport::CastTransportStatus status) { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // Make sure that we do a re-send. | 245 // Make sure that we do a re-send. |
| 244 RunTasks(max_resend_timeout.InMilliseconds()); | 246 RunTasks(max_resend_timeout.InMilliseconds()); |
| 245 // Should have sent at least 3 packets. | 247 // Should have sent at least 3 packets. |
| 246 EXPECT_GE( | 248 EXPECT_GE( |
| 247 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), | 249 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), |
| 248 3); | 250 3); |
| 249 } | 251 } |
| 250 | 252 |
| 251 } // namespace cast | 253 } // namespace cast |
| 252 } // namespace media | 254 } // namespace media |
| OLD | NEW |