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

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

Issue 25544003: Fix code style and gyp files in cast to build cast_unittest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed gyp files 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 18 matching lines...) Expand all
29 public: 29 public:
30 TestVideoDecoderCallback() 30 TestVideoDecoderCallback()
31 : num_called_(0) {} 31 : num_called_(0) {}
32 // TODO(mikhal): Set and check expectations. 32 // TODO(mikhal): Set and check expectations.
33 void DecodeComplete(scoped_ptr<I420VideoFrame> frame, 33 void DecodeComplete(scoped_ptr<I420VideoFrame> frame,
34 const base::TimeTicks render_time) { 34 const base::TimeTicks render_time) {
35 num_called_++; 35 num_called_++;
36 } 36 }
37 37
38 int number_times_called() {return num_called_;} 38 int number_times_called() {return num_called_;}
39
40 protected:
41 virtual ~TestVideoDecoderCallback() {}
42
39 private: 43 private:
44 friend class base::RefCountedThreadSafe<TestVideoDecoderCallback>;
45
40 int num_called_; 46 int num_called_;
41 }; 47 };
42 48
43 class VideoDecoderTest : public ::testing::Test { 49 class VideoDecoderTest : public ::testing::Test {
44 protected: 50 protected:
45 VideoDecoderTest() { 51 VideoDecoderTest() {
46 // Configure to vp8. 52 // Configure to vp8.
47 config_.codec = kVp8; 53 config_.codec = kVp8;
48 config_.use_external_decoder = false; 54 config_.use_external_decoder = false;
49 video_decoder_callback_ = new TestVideoDecoderCallback(); 55 video_decoder_callback_ = new TestVideoDecoderCallback();
50 } 56 }
51 57
52 ~VideoDecoderTest() {} 58 virtual ~VideoDecoderTest() {}
53 virtual void SetUp() { 59 virtual void SetUp() {
54 task_runner_ = new test::FakeTaskRunner(&testing_clock_); 60 task_runner_ = new test::FakeTaskRunner(&testing_clock_);
55 cast_thread_ = new CastThread(task_runner_, NULL, NULL, 61 cast_thread_ = new CastThread(task_runner_, NULL, NULL,
56 NULL, task_runner_); 62 NULL, task_runner_);
57 decoder_ = new VideoDecoder(cast_thread_, config_); 63 decoder_ = new VideoDecoder(cast_thread_, config_);
58 } 64 }
59 65
60 scoped_refptr<VideoDecoder> decoder_; 66 scoped_refptr<VideoDecoder> decoder_;
61 VideoReceiverConfig config_; 67 VideoReceiverConfig config_;
62 EncodedVideoFrame encoded_frame_; 68 EncodedVideoFrame encoded_frame_;
(...skipping 22 matching lines...) Expand all
85 video_decoder_callback_.get()); 91 video_decoder_callback_.get());
86 encoded_frame_.data.assign(kFrameSize, 0); 92 encoded_frame_.data.assign(kFrameSize, 0);
87 encoded_frame_.codec = kExternalVideo; 93 encoded_frame_.codec = kExternalVideo;
88 EXPECT_DEATH(decoder_->DecodeVideoFrame(&encoded_frame_, render_time, 94 EXPECT_DEATH(decoder_->DecodeVideoFrame(&encoded_frame_, render_time,
89 frame_decoded_callback, base::Bind(ReleaseFrame, &encoded_frame_)), 95 frame_decoded_callback, base::Bind(ReleaseFrame, &encoded_frame_)),
90 "Invalid codec"); 96 "Invalid codec");
91 } 97 }
92 98
93 } // namespace cast 99 } // namespace cast
94 } // namespace media 100 } // 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