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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 virtual ~VideoEncoderImplTest() {} | 88 virtual ~VideoEncoderImplTest() {} |
89 | 89 |
90 virtual void SetUp() OVERRIDE { | 90 virtual void SetUp() OVERRIDE { |
91 testing_clock_ = new base::SimpleTestTickClock(); | 91 testing_clock_ = new base::SimpleTestTickClock(); |
92 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); | 92 task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); |
93 cast_environment_ = | 93 cast_environment_ = |
94 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), | 94 new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), |
95 task_runner_, | 95 task_runner_, |
96 task_runner_, | 96 task_runner_, |
97 task_runner_, | 97 task_runner_); |
98 GetDefaultCastSenderLoggingConfig()); | |
99 } | 98 } |
100 | 99 |
101 virtual void TearDown() OVERRIDE { | 100 virtual void TearDown() OVERRIDE { |
102 video_encoder_.reset(); | 101 video_encoder_.reset(); |
103 task_runner_->RunTasks(); | 102 task_runner_->RunTasks(); |
104 } | 103 } |
105 | 104 |
106 void Configure(uint8 max_unacked_frames) { | 105 void Configure(uint8 max_unacked_frames) { |
107 video_encoder_.reset(new VideoEncoderImpl( | 106 video_encoder_.reset(new VideoEncoderImpl( |
108 cast_environment_, video_config_, max_unacked_frames)); | 107 cast_environment_, video_config_, max_unacked_frames)); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 for (int i = 5; i < 17; ++i) { | 250 for (int i = 5; i < 17; ++i) { |
252 test_video_encoder_callback_->SetExpectedResult(false, i, 4, capture_time); | 251 test_video_encoder_callback_->SetExpectedResult(false, i, 4, capture_time); |
253 EXPECT_TRUE(video_encoder_->EncodeVideoFrame( | 252 EXPECT_TRUE(video_encoder_->EncodeVideoFrame( |
254 video_frame_, capture_time, frame_encoded_callback)); | 253 video_frame_, capture_time, frame_encoded_callback)); |
255 task_runner_->RunTasks(); | 254 task_runner_->RunTasks(); |
256 } | 255 } |
257 } | 256 } |
258 | 257 |
259 } // namespace cast | 258 } // namespace cast |
260 } // namespace media | 259 } // namespace media |
OLD | NEW |