| 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/test/simple_test_tick_clock.h" | 7 #include "base/test/simple_test_tick_clock.h" |
| 8 #include "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
| 9 #include "media/cast/cast_config.h" | 9 #include "media/cast/cast_config.h" |
| 10 #include "media/cast/cast_defines.h" | 10 #include "media/cast/cast_defines.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 class VideoDecoderTest : public ::testing::Test { | 44 class VideoDecoderTest : public ::testing::Test { |
| 45 protected: | 45 protected: |
| 46 VideoDecoderTest() | 46 VideoDecoderTest() |
| 47 : testing_clock_(new base::SimpleTestTickClock()), | 47 : testing_clock_(new base::SimpleTestTickClock()), |
| 48 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), | 48 task_runner_(new test::FakeSingleThreadTaskRunner(testing_clock_)), |
| 49 cast_environment_( | 49 cast_environment_( |
| 50 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_), | 50 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_), |
| 51 task_runner_, | 51 task_runner_, |
| 52 task_runner_, | 52 task_runner_, |
| 53 task_runner_, | 53 task_runner_)), |
| 54 GetDefaultCastReceiverLoggingConfig())), | |
| 55 test_callback_(new DecodeTestFrameCallback()) { | 54 test_callback_(new DecodeTestFrameCallback()) { |
| 56 // Configure to vp8. | 55 // Configure to vp8. |
| 57 config_.codec = transport::kVp8; | 56 config_.codec = transport::kVp8; |
| 58 config_.use_external_decoder = false; | 57 config_.use_external_decoder = false; |
| 59 decoder_.reset(new VideoDecoder(config_, cast_environment_)); | 58 decoder_.reset(new VideoDecoder(config_, cast_environment_)); |
| 60 testing_clock_->Advance( | 59 testing_clock_->Advance( |
| 61 base::TimeDelta::FromMilliseconds(kStartMillisecond)); | 60 base::TimeDelta::FromMilliseconds(kStartMillisecond)); |
| 62 } | 61 } |
| 63 | 62 |
| 64 virtual ~VideoDecoderTest() {} | 63 virtual ~VideoDecoderTest() {} |
| (...skipping 18 matching lines...) Expand all Loading... |
| 83 &encoded_frame, | 82 &encoded_frame, |
| 84 render_time, | 83 render_time, |
| 85 base::Bind(&DecodeTestFrameCallback::DecodeComplete, test_callback_)), | 84 base::Bind(&DecodeTestFrameCallback::DecodeComplete, test_callback_)), |
| 86 "Empty frame"); | 85 "Empty frame"); |
| 87 } | 86 } |
| 88 | 87 |
| 89 // TODO(pwestin): Test decoding a real frame. | 88 // TODO(pwestin): Test decoding a real frame. |
| 90 | 89 |
| 91 } // namespace cast | 90 } // namespace cast |
| 92 } // namespace media | 91 } // namespace media |
| OLD | NEW |