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

Side by Side Diff: media/cast/video_receiver/video_decoder_unittest.cc

Issue 25604007: Revert 226305 "Fix code style and gyp files in cast to build cas..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1658/src/
Patch Set: Created 7 years, 2 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
« no previous file with comments | « media/cast/video_receiver/video_decoder.h ('k') | media/cast/video_receiver/video_receiver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/test/simple_test_tick_clock.h" 8 #include "base/test/simple_test_tick_clock.h"
9 #include "media/cast/cast_defines.h" 9 #include "media/cast/cast_defines.h"
10 #include "media/cast/cast_thread.h" 10 #include "media/cast/cast_thread.h"
(...skipping 17 matching lines...) Expand all
28 public base::RefCountedThreadSafe<TestVideoDecoderCallback> { 28 public base::RefCountedThreadSafe<TestVideoDecoderCallback> {
29 public: 29 public:
30 TestVideoDecoderCallback() 30 TestVideoDecoderCallback()
31 : num_called_(0) {} 31 : num_called_(0) {}
32 void DecodeComplete(scoped_ptr<I420VideoFrame> frame, 32 void DecodeComplete(scoped_ptr<I420VideoFrame> frame,
33 const base::TimeTicks render_time) { 33 const base::TimeTicks render_time) {
34 num_called_++; 34 num_called_++;
35 } 35 }
36 36
37 int number_times_called() {return num_called_;} 37 int number_times_called() {return num_called_;}
38
39 protected:
40 virtual ~TestVideoDecoderCallback() {}
41
42 private: 38 private:
43 friend class base::RefCountedThreadSafe<TestVideoDecoderCallback>;
44
45 int num_called_; 39 int num_called_;
46 }; 40 };
47 41
48 class VideoDecoderTest : public ::testing::Test { 42 class VideoDecoderTest : public ::testing::Test {
49 protected: 43 protected:
50 VideoDecoderTest() { 44 VideoDecoderTest() {
51 // Configure to vp8. 45 // Configure to vp8.
52 config_.codec = kVp8; 46 config_.codec = kVp8;
53 config_.use_external_decoder = false; 47 config_.use_external_decoder = false;
54 video_decoder_callback_ = new TestVideoDecoderCallback(); 48 video_decoder_callback_ = new TestVideoDecoderCallback();
55 } 49 }
56 50
57 virtual ~VideoDecoderTest() {} 51 ~VideoDecoderTest() {}
58 virtual void SetUp() { 52 virtual void SetUp() {
59 task_runner_ = new test::FakeTaskRunner(&testing_clock_); 53 task_runner_ = new test::FakeTaskRunner(&testing_clock_);
60 cast_thread_ = new CastThread(task_runner_, NULL, NULL, 54 cast_thread_ = new CastThread(task_runner_, NULL, NULL,
61 NULL, task_runner_); 55 NULL, task_runner_);
62 decoder_ = new VideoDecoder(cast_thread_, config_); 56 decoder_ = new VideoDecoder(cast_thread_, config_);
63 } 57 }
64 58
65 scoped_refptr<VideoDecoder> decoder_; 59 scoped_refptr<VideoDecoder> decoder_;
66 VideoReceiverConfig config_; 60 VideoReceiverConfig config_;
67 EncodedVideoFrame encoded_frame_; 61 EncodedVideoFrame encoded_frame_;
(...skipping 21 matching lines...) Expand all
89 video_decoder_callback_.get()); 83 video_decoder_callback_.get());
90 encoded_frame_.data.assign(kFrameSize, 0); 84 encoded_frame_.data.assign(kFrameSize, 0);
91 encoded_frame_.codec = kExternalVideo; 85 encoded_frame_.codec = kExternalVideo;
92 EXPECT_DEATH(decoder_->DecodeVideoFrame(&encoded_frame_, render_time, 86 EXPECT_DEATH(decoder_->DecodeVideoFrame(&encoded_frame_, render_time,
93 frame_decoded_callback, base::Bind(ReleaseFrame, &encoded_frame_)), 87 frame_decoded_callback, base::Bind(ReleaseFrame, &encoded_frame_)),
94 "Invalid codec"); 88 "Invalid codec");
95 } 89 }
96 90
97 } // namespace cast 91 } // namespace cast
98 } // namespace media 92 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_receiver/video_decoder.h ('k') | media/cast/video_receiver/video_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698