| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 void RunTasks(int during_ms) { | 160 void RunTasks(int during_ms) { |
| 161 for (int i = 0; i < during_ms; ++i) { | 161 for (int i = 0; i < during_ms; ++i) { |
| 162 // Call process the timers every 1 ms. | 162 // Call process the timers every 1 ms. |
| 163 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1)); | 163 testing_clock_->Advance(base::TimeDelta::FromMilliseconds(1)); |
| 164 task_runner_->RunTasks(); | 164 task_runner_->RunTasks(); |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 void InitializationResult(CastInitializationStatus result) { | 168 void InitializationResult(CastInitializationStatus result) { |
| 169 EXPECT_EQ(result, STATUS_INITIALIZED); | 169 EXPECT_EQ(result, STATUS_VIDEO_INITIALIZED); |
| 170 } | 170 } |
| 171 | 171 |
| 172 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. | 172 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. |
| 173 TestPacketSender transport_; | 173 TestPacketSender transport_; |
| 174 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_; | 174 scoped_ptr<transport::CastTransportSenderImpl> transport_sender_; |
| 175 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_; | 175 scoped_refptr<test::FakeSingleThreadTaskRunner> task_runner_; |
| 176 scoped_ptr<PeerVideoSender> video_sender_; | 176 scoped_ptr<PeerVideoSender> video_sender_; |
| 177 scoped_refptr<CastEnvironment> cast_environment_; | 177 scoped_refptr<CastEnvironment> cast_environment_; |
| 178 | 178 |
| 179 DISALLOW_COPY_AND_ASSIGN(VideoSenderTest); | 179 DISALLOW_COPY_AND_ASSIGN(VideoSenderTest); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // Make sure that we do a re-send. | 248 // Make sure that we do a re-send. |
| 249 RunTasks(max_resend_timeout.InMilliseconds()); | 249 RunTasks(max_resend_timeout.InMilliseconds()); |
| 250 // Should have sent at least 3 packets. | 250 // Should have sent at least 3 packets. |
| 251 EXPECT_GE( | 251 EXPECT_GE( |
| 252 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), | 252 transport_.number_of_rtp_packets() + transport_.number_of_rtcp_packets(), |
| 253 3); | 253 3); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace cast | 256 } // namespace cast |
| 257 } // namespace media | 257 } // namespace media |
| OLD | NEW |