| 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 <gtest/gtest.h> | 5 #include <gtest/gtest.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_); | 74 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_); |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual ~CastTransportSenderImplTest() {} | 77 virtual ~CastTransportSenderImplTest() {} |
| 78 | 78 |
| 79 void InitWithoutLogging() { | 79 void InitWithoutLogging() { |
| 80 transport_sender_.reset( | 80 transport_sender_.reset( |
| 81 new CastTransportSenderImpl(NULL, | 81 new CastTransportSenderImpl(NULL, |
| 82 &testing_clock_, | 82 &testing_clock_, |
| 83 net::IPEndPoint(), | 83 net::IPEndPoint(), |
| 84 "", |
| 84 base::Bind(&UpdateCastTransportStatus), | 85 base::Bind(&UpdateCastTransportStatus), |
| 85 BulkRawEventsCallback(), | 86 BulkRawEventsCallback(), |
| 86 base::TimeDelta(), | 87 base::TimeDelta(), |
| 87 task_runner_, | 88 task_runner_, |
| 88 &transport_)); | 89 &transport_)); |
| 89 task_runner_->RunTasks(); | 90 task_runner_->RunTasks(); |
| 90 } | 91 } |
| 91 | 92 |
| 92 void InitWithLogging() { | 93 void InitWithLogging() { |
| 93 transport_sender_.reset(new CastTransportSenderImpl( | 94 transport_sender_.reset(new CastTransportSenderImpl( |
| 94 NULL, | 95 NULL, |
| 95 &testing_clock_, | 96 &testing_clock_, |
| 96 net::IPEndPoint(), | 97 net::IPEndPoint(), |
| 98 "", |
| 97 base::Bind(&UpdateCastTransportStatus), | 99 base::Bind(&UpdateCastTransportStatus), |
| 98 base::Bind(&CastTransportSenderImplTest::LogRawEvents, | 100 base::Bind(&CastTransportSenderImplTest::LogRawEvents, |
| 99 base::Unretained(this)), | 101 base::Unretained(this)), |
| 100 base::TimeDelta::FromMilliseconds(10), | 102 base::TimeDelta::FromMilliseconds(10), |
| 101 task_runner_, | 103 task_runner_, |
| 102 &transport_)); | 104 &transport_)); |
| 103 task_runner_->RunTasks(); | 105 task_runner_->RunTasks(); |
| 104 } | 106 } |
| 105 | 107 |
| 106 void InitializeVideo() { | 108 void InitializeVideo() { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); | 343 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); |
| 342 transport_sender_->OnReceivedCastMessage(kVideoSsrc, | 344 transport_sender_->OnReceivedCastMessage(kVideoSsrc, |
| 343 RtcpCastMessageCallback(), | 345 RtcpCastMessageCallback(), |
| 344 cast_message); | 346 cast_message); |
| 345 task_runner_->RunTasks(); | 347 task_runner_->RunTasks(); |
| 346 EXPECT_EQ(7, transport_.packets_sent()); | 348 EXPECT_EQ(7, transport_.packets_sent()); |
| 347 } | 349 } |
| 348 | 350 |
| 349 } // namespace cast | 351 } // namespace cast |
| 350 } // namespace media | 352 } // namespace media |
| OLD | NEW |