| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "media/cast/sender/h264_vt_encoder.h" | 27 #include "media/cast/sender/h264_vt_encoder.h" |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 namespace media { | 30 namespace media { |
| 31 namespace cast { | 31 namespace cast { |
| 32 | 32 |
| 33 class VideoEncoderTest | 33 class VideoEncoderTest |
| 34 : public ::testing::TestWithParam<std::pair<Codec, bool>> { | 34 : public ::testing::TestWithParam<std::pair<Codec, bool>> { |
| 35 protected: | 35 protected: |
| 36 VideoEncoderTest() | 36 VideoEncoderTest() |
| 37 : testing_clock_(new base::SimpleTestTickClock()), | 37 : testing_clock_(new base::SimpleTestTickClock(base::TimeTicks::Now())), |
| 38 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), | 38 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), |
| 39 cast_environment_( | 39 cast_environment_( |
| 40 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_), | 40 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_), |
| 41 task_runner_, | 41 task_runner_, |
| 42 task_runner_, | 42 task_runner_, |
| 43 task_runner_)), | 43 task_runner_)), |
| 44 video_config_(GetDefaultVideoSenderConfig()), | 44 video_config_(GetDefaultVideoSenderConfig()), |
| 45 operational_status_(STATUS_UNINITIALIZED), | 45 operational_status_(STATUS_UNINITIALIZED), |
| 46 count_frames_delivered_(0) { | 46 count_frames_delivered_(0) { |
| 47 testing_clock_->Advance(base::TimeTicks::Now() - base::TimeTicks()); | |
| 48 first_frame_time_ = testing_clock_->NowTicks(); | 47 first_frame_time_ = testing_clock_->NowTicks(); |
| 49 } | 48 } |
| 50 | 49 |
| 51 ~VideoEncoderTest() override {} | 50 ~VideoEncoderTest() override {} |
| 52 | 51 |
| 53 void SetUp() final { | 52 void SetUp() final { |
| 54 video_config_.codec = GetParam().first; | 53 video_config_.codec = GetParam().first; |
| 55 video_config_.use_external_encoder = GetParam().second; | 54 video_config_.use_external_encoder = GetParam().second; |
| 56 | 55 |
| 57 if (video_config_.use_external_encoder) | 56 if (video_config_.use_external_encoder) |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 #endif | 420 #endif |
| 422 return values; | 421 return values; |
| 423 } | 422 } |
| 424 } // namespace | 423 } // namespace |
| 425 | 424 |
| 426 INSTANTIATE_TEST_CASE_P( | 425 INSTANTIATE_TEST_CASE_P( |
| 427 , VideoEncoderTest, ::testing::ValuesIn(DetermineEncodersToTest())); | 426 , VideoEncoderTest, ::testing::ValuesIn(DetermineEncodersToTest())); |
| 428 | 427 |
| 429 } // namespace cast | 428 } // namespace cast |
| 430 } // namespace media | 429 } // namespace media |
| OLD | NEW |