Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: media/cast/video_sender/video_encoder_impl_unittest.cc

Issue 132283006: Revert of Cast: Fix threading issues in VideoEncoderImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 virtual ~VideoEncoderImplTest() {} 86 virtual ~VideoEncoderImplTest() {}
87 87
88 virtual void SetUp() { 88 virtual void SetUp() {
89 task_runner_ = new test::FakeTaskRunner(&testing_clock_); 89 task_runner_ = new test::FakeTaskRunner(&testing_clock_);
90 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_, 90 cast_environment_ = new CastEnvironment(&testing_clock_, task_runner_,
91 task_runner_, task_runner_, task_runner_, task_runner_, 91 task_runner_, task_runner_, task_runner_, task_runner_,
92 task_runner_, GetDefaultCastSenderLoggingConfig()); 92 task_runner_, GetDefaultCastSenderLoggingConfig());
93 } 93 }
94 94
95 virtual void TearDown() OVERRIDE {
96 video_encoder_.reset();
97 task_runner_->RunTasks();
98 }
99
100 void Configure(uint8 max_unacked_frames) { 95 void Configure(uint8 max_unacked_frames) {
101 video_encoder_.reset(new VideoEncoderImpl(cast_environment_, video_config_, 96 video_encoder_.reset(new VideoEncoderImpl(cast_environment_, video_config_,
102 max_unacked_frames)); 97 max_unacked_frames));
103 } 98 }
104 99
105 base::SimpleTestTickClock testing_clock_; 100 base::SimpleTestTickClock testing_clock_;
106 scoped_refptr<TestVideoEncoderCallback> test_video_encoder_callback_; 101 scoped_refptr<TestVideoEncoderCallback> test_video_encoder_callback_;
107 VideoSenderConfig video_config_; 102 VideoSenderConfig video_config_;
108 scoped_refptr<test::FakeTaskRunner> task_runner_; 103 scoped_refptr<test::FakeTaskRunner> task_runner_;
109 scoped_ptr<VideoEncoder> video_encoder_; 104 scoped_ptr<VideoEncoder> video_encoder_;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 for (int i = 5; i < 17; ++i) { 238 for (int i = 5; i < 17; ++i) {
244 test_video_encoder_callback_->SetExpectedResult(false, i, 4, capture_time); 239 test_video_encoder_callback_->SetExpectedResult(false, i, 4, capture_time);
245 EXPECT_TRUE(video_encoder_->EncodeVideoFrame(video_frame_, capture_time, 240 EXPECT_TRUE(video_encoder_->EncodeVideoFrame(video_frame_, capture_time,
246 frame_encoded_callback)); 241 frame_encoded_callback));
247 task_runner_->RunTasks(); 242 task_runner_->RunTasks();
248 } 243 }
249 } 244 }
250 245
251 } // namespace cast 246 } // namespace cast
252 } // namespace media 247 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_sender/video_encoder_impl.cc ('k') | media/cast/video_sender/video_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698