| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 }; | 76 }; |
| 77 } // namespace | 77 } // namespace |
| 78 | 78 |
| 79 class VideoSenderTest : public ::testing::Test { | 79 class VideoSenderTest : public ::testing::Test { |
| 80 protected: | 80 protected: |
| 81 VideoSenderTest() { | 81 VideoSenderTest() { |
| 82 testing_clock_ = new base::SimpleTestTickClock(); | 82 testing_clock_ = new base::SimpleTestTickClock(); |
| 83 testing_clock_->Advance( | 83 testing_clock_->Advance( |
| 84 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 84 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
| 85 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); | 85 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); |
| 86 CastLoggingConfig logging_config = |
| 87 GetLoggingConfigWithRawEventsAndStatsEnabled(); |
| 86 cast_environment_ = | 88 cast_environment_ = |
| 87 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 89 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
| 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 task_runner_, | 94 task_runner_, |
| 93 task_runner_, | 95 task_runner_, |
| 94 GetLoggingConfigWithRawEventsAndStatsEnabled()); | 96 logging_config); |
| 95 transport::CastTransportConfig transport_config; | 97 transport::CastTransportConfig transport_config; |
| 96 transport_sender_.reset(new transport::CastTransportSenderImpl( | 98 transport_sender_.reset(new transport::CastTransportSenderImpl( |
| 97 NULL, | 99 NULL, |
| 98 testing_clock_, | 100 testing_clock_, |
| 99 transport_config, | 101 transport_config, |
| 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 } | 108 } |
| 104 | 109 |
| 105 virtual ~VideoSenderTest() {} | 110 virtual ~VideoSenderTest() {} |
| 106 | 111 |
| 107 virtual void TearDown() OVERRIDE { | 112 virtual void TearDown() OVERRIDE { |
| 108 video_sender_.reset(); | 113 video_sender_.reset(); |
| 109 task_runner_->RunTasks(); | 114 task_runner_->RunTasks(); |
| 110 } | 115 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 285 |
| 281 ASSERT_TRUE(!frame_events.empty()); | 286 ASSERT_TRUE(!frame_events.empty()); |
| 282 EXPECT_EQ(kVideoAckReceived, frame_events.rbegin()->type); | 287 EXPECT_EQ(kVideoAckReceived, frame_events.rbegin()->type); |
| 283 EXPECT_EQ(num_frames - 1u, frame_events.rbegin()->frame_id); | 288 EXPECT_EQ(num_frames - 1u, frame_events.rbegin()->frame_id); |
| 284 | 289 |
| 285 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); | 290 cast_environment_->Logging()->RemoveRawEventSubscriber(&event_subscriber); |
| 286 } | 291 } |
| 287 | 292 |
| 288 } // namespace cast | 293 } // namespace cast |
| 289 } // namespace media | 294 } // namespace media |
| OLD | NEW |