| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 }; | 74 }; |
| 75 } // namespace | 75 } // namespace |
| 76 | 76 |
| 77 class VideoSenderTest : public ::testing::Test { | 77 class VideoSenderTest : public ::testing::Test { |
| 78 protected: | 78 protected: |
| 79 VideoSenderTest() { | 79 VideoSenderTest() { |
| 80 testing_clock_ = new base::SimpleTestTickClock(); | 80 testing_clock_ = new base::SimpleTestTickClock(); |
| 81 testing_clock_->Advance( | 81 testing_clock_->Advance( |
| 82 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 82 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
| 83 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); | 83 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); |
| 84 CastLoggingConfig logging_config = |
| 85 GetLoggingConfigWithRawEventsAndStatsEnabled(); |
| 84 cast_environment_ = | 86 cast_environment_ = |
| 85 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 87 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
| 86 task_runner_, | 88 task_runner_, |
| 87 task_runner_, | 89 task_runner_, |
| 88 task_runner_, | 90 task_runner_, |
| 89 task_runner_, | 91 task_runner_, |
| 90 task_runner_, | 92 task_runner_, |
| 91 task_runner_, | 93 task_runner_, |
| 92 GetLoggingConfigWithRawEventsAndStatsEnabled()); | 94 logging_config); |
| 93 transport::CastTransportVideoConfig transport_config; | 95 transport::CastTransportVideoConfig transport_config; |
| 94 net::IPEndPoint dummy_endpoint; | 96 net::IPEndPoint dummy_endpoint; |
| 95 transport_sender_.reset(new transport::CastTransportSenderImpl( | 97 transport_sender_.reset(new transport::CastTransportSenderImpl( |
| 96 NULL, | 98 NULL, |
| 97 testing_clock_, | 99 testing_clock_, |
| 98 dummy_endpoint, | 100 dummy_endpoint, |
| 99 dummy_endpoint, | 101 dummy_endpoint, |
| 102 logging_config, |
| 100 base::Bind(&UpdateCastTransportStatus), | 103 base::Bind(&UpdateCastTransportStatus), |
| 104 transport::BulkRawEventsCallback(), |
| 105 base::TimeDelta(), |
| 101 task_runner_, | 106 task_runner_, |
| 102 &transport_)); | 107 &transport_)); |
| 103 transport_sender_->InitializeVideo(transport_config); | 108 transport_sender_->InitializeVideo(transport_config); |
| 104 } | 109 } |
| 105 | 110 |
| 106 virtual ~VideoSenderTest() {} | 111 virtual ~VideoSenderTest() {} |
| 107 | 112 |
| 108 virtual void TearDown() OVERRIDE { | 113 virtual void TearDown() OVERRIDE { |
| 109 video_sender_.reset(); | 114 video_sender_.reset(); |
| 110 task_runner_->RunTasks(); | 115 task_runner_->RunTasks(); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 // Empty the pipeline. | 335 // Empty the pipeline. |
| 331 RunTasks(100); | 336 RunTasks(100); |
| 332 // Should have sent at least 7 packets. | 337 // Should have sent at least 7 packets. |
| 333 EXPECT_GE( | 338 EXPECT_GE( |
| 334 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), | 339 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), |
| 335 7); | 340 7); |
| 336 } | 341 } |
| 337 | 342 |
| 338 } // namespace cast | 343 } // namespace cast |
| 339 } // namespace media | 344 } // namespace media |
| OLD | NEW |