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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 }; | 94 }; |
95 } // namespace | 95 } // namespace |
96 | 96 |
97 class VideoSenderTest : public ::testing::Test { | 97 class VideoSenderTest : public ::testing::Test { |
98 protected: | 98 protected: |
99 VideoSenderTest() { | 99 VideoSenderTest() { |
100 testing_clock_ = new base::SimpleTestTickClock(); | 100 testing_clock_ = new base::SimpleTestTickClock(); |
101 testing_clock_->Advance( | 101 testing_clock_->Advance( |
102 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 102 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
103 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); | 103 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); |
104 CastLoggingConfig logging_config = | |
105 GetLoggingConfigWithRawEventsAndStatsEnabled(); | |
106 cast_environment_ = | 104 cast_environment_ = |
107 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 105 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
108 task_runner_, | 106 task_runner_, |
109 task_runner_, | 107 task_runner_, |
110 task_runner_, | 108 task_runner_); |
111 logging_config); | |
112 transport::CastTransportVideoConfig transport_config; | 109 transport::CastTransportVideoConfig transport_config; |
113 net::IPEndPoint dummy_endpoint; | 110 net::IPEndPoint dummy_endpoint; |
114 transport_sender_.reset(new transport::CastTransportSenderImpl( | 111 transport_sender_.reset(new transport::CastTransportSenderImpl( |
115 NULL, | 112 NULL, |
116 testing_clock_, | 113 testing_clock_, |
117 dummy_endpoint, | 114 dummy_endpoint, |
118 logging_config, | |
119 base::Bind(&UpdateCastTransportStatus), | 115 base::Bind(&UpdateCastTransportStatus), |
120 transport::BulkRawEventsCallback(), | 116 transport::BulkRawEventsCallback(), |
121 base::TimeDelta(), | 117 base::TimeDelta(), |
122 task_runner_, | 118 task_runner_, |
123 &transport_)); | 119 &transport_)); |
124 transport_sender_->InitializeVideo(transport_config); | 120 transport_sender_->InitializeVideo(transport_config); |
125 } | 121 } |
126 | 122 |
127 virtual ~VideoSenderTest() {} | 123 virtual ~VideoSenderTest() {} |
128 | 124 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // Empty the pipeline. | 361 // Empty the pipeline. |
366 RunTasks(100); | 362 RunTasks(100); |
367 // Should have sent at least 7 packets. | 363 // Should have sent at least 7 packets. |
368 EXPECT_GE( | 364 EXPECT_GE( |
369 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), | 365 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), |
370 7); | 366 7); |
371 } | 367 } |
372 | 368 |
373 } // namespace cast | 369 } // namespace cast |
374 } // namespace media | 370 } // namespace media |
OLD | NEW |