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 // Joint encoder and decoder testing. | 5 // Joint encoder and decoder testing. |
6 // These tests operate directly on the VP8 encoder and decoder, not the | 6 // These tests operate directly on the VP8 encoder and decoder, not the |
7 // transport layer, and are targeted at validating the bit stream. | 7 // transport layer, and are targeted at validating the bit stream. |
8 | 8 |
9 #include <gtest/gtest.h> | 9 #include <gtest/gtest.h> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 scoped_ptr<Vp8Decoder> decoder_; | 115 scoped_ptr<Vp8Decoder> decoder_; |
116 scoped_refptr<media::VideoFrame> video_frame_; | 116 scoped_refptr<media::VideoFrame> video_frame_; |
117 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. | 117 base::SimpleTestTickClock* testing_clock_; // Owned by CastEnvironment. |
118 scoped_refptr<test::FakeTaskRunner> task_runner_; | 118 scoped_refptr<test::FakeTaskRunner> task_runner_; |
119 scoped_refptr<CastEnvironment> cast_environment_; | 119 scoped_refptr<CastEnvironment> cast_environment_; |
120 scoped_refptr<EncodeDecodeTestFrameCallback> test_callback_; | 120 scoped_refptr<EncodeDecodeTestFrameCallback> test_callback_; |
121 }; | 121 }; |
122 | 122 |
123 TEST_F(EncodeDecodeTest, BasicEncodeDecode) { | 123 TEST_F(EncodeDecodeTest, BasicEncodeDecode) { |
124 transport::EncodedVideoFrame encoded_frame; | 124 transport::EncodedVideoFrame encoded_frame; |
| 125 encoder_->Initialize(); |
125 // Encode frame. | 126 // Encode frame. |
126 encoder_->Encode(video_frame_, &encoded_frame); | 127 encoder_->Encode(video_frame_, &encoded_frame); |
127 EXPECT_GT(encoded_frame.data.size(), GG_UINT64_C(0)); | 128 EXPECT_GT(encoded_frame.data.size(), GG_UINT64_C(0)); |
128 // Decode frame. | 129 // Decode frame. |
129 decoder_->Decode(&encoded_frame, base::TimeTicks(), base::Bind( | 130 decoder_->Decode(&encoded_frame, base::TimeTicks(), base::Bind( |
130 &EncodeDecodeTestFrameCallback::DecodeComplete, test_callback_)); | 131 &EncodeDecodeTestFrameCallback::DecodeComplete, test_callback_)); |
131 task_runner_->RunTasks(); | 132 task_runner_->RunTasks(); |
132 } | 133 } |
133 | 134 |
134 } // namespace cast | 135 } // namespace cast |
135 } // namespace media | 136 } // namespace media |
OLD | NEW |