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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 class CastTransportSenderImplTest : public ::testing::Test { | 67 class CastTransportSenderImplTest : public ::testing::Test { |
68 protected: | 68 protected: |
69 CastTransportSenderImplTest() | 69 CastTransportSenderImplTest() |
70 : num_times_callback_called_(0) { | 70 : num_times_callback_called_(0) { |
71 testing_clock_.Advance( | 71 testing_clock_.Advance( |
72 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 72 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
73 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_); | 73 task_runner_ = new test::FakeSingleThreadTaskRunner(&testing_clock_); |
74 } | 74 } |
75 | 75 |
76 virtual ~CastTransportSenderImplTest() {} | 76 ~CastTransportSenderImplTest() override {} |
77 | 77 |
78 void InitWithoutLogging() { | 78 void InitWithoutLogging() { |
79 transport_sender_.reset( | 79 transport_sender_.reset( |
80 new CastTransportSenderImpl(NULL, | 80 new CastTransportSenderImpl(NULL, |
81 &testing_clock_, | 81 &testing_clock_, |
82 net::IPEndPoint(), | 82 net::IPEndPoint(), |
83 make_scoped_ptr(new base::DictionaryValue), | 83 make_scoped_ptr(new base::DictionaryValue), |
84 base::Bind(&UpdateCastTransportStatus), | 84 base::Bind(&UpdateCastTransportStatus), |
85 BulkRawEventsCallback(), | 85 BulkRawEventsCallback(), |
86 base::TimeDelta(), | 86 base::TimeDelta(), |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); | 367 task_runner_->Sleep(base::TimeDelta::FromMilliseconds(2)); |
368 transport_sender_->OnReceivedCastMessage(kVideoSsrc, | 368 transport_sender_->OnReceivedCastMessage(kVideoSsrc, |
369 RtcpCastMessageCallback(), | 369 RtcpCastMessageCallback(), |
370 cast_message); | 370 cast_message); |
371 task_runner_->RunTasks(); | 371 task_runner_->RunTasks(); |
372 EXPECT_EQ(7, transport_.packets_sent()); | 372 EXPECT_EQ(7, transport_.packets_sent()); |
373 } | 373 } |
374 | 374 |
375 } // namespace cast | 375 } // namespace cast |
376 } // namespace media | 376 } // namespace media |
OLD | NEW |