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

Side by Side Diff: media/filters/bitstream_converter_unittest.cc

Issue 6993042: ffmpeg chromium glue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: once more new test_expectations.txt Created 9 years, 5 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/filters/bitstream_converter.cc ('k') | media/filters/chunk_demuxer.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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <deque> 5 #include <deque>
6 6
7 #include "media/base/mock_ffmpeg.h" 7 #include "media/base/mock_ffmpeg.h"
8 #include "media/ffmpeg/ffmpeg_common.h" 8 #include "media/ffmpeg/ffmpeg_common.h"
9 #include "media/filters/bitstream_converter.h" 9 #include "media/filters/bitstream_converter.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 FFmpegBitstreamConverter converter(kTestFilterName, &test_stream_context_); 84 FFmpegBitstreamConverter converter(kTestFilterName, &test_stream_context_);
85 85
86 // Inject mock filter instance. 86 // Inject mock filter instance.
87 converter.stream_filter_ = &test_filter_; 87 converter.stream_filter_ = &test_filter_;
88 88
89 // Simulate a successful filter call, that allocates a new data buffer. 89 // Simulate a successful filter call, that allocates a new data buffer.
90 EXPECT_CALL(mock_ffmpeg_, 90 EXPECT_CALL(mock_ffmpeg_,
91 AVBitstreamFilterFilter(&test_filter_, &test_stream_context_, 91 AVBitstreamFilterFilter(&test_filter_, &test_stream_context_,
92 NULL, _, _, 92 NULL, _, _,
93 test_packet_.data, test_packet_.size, _)) 93 test_packet_.data, test_packet_.size, _))
94 .WillOnce(Return(AVERROR_UNKNOWN)); 94 .WillOnce(Return(AVERROR(EINVAL)));
95 95
96 EXPECT_FALSE(converter.ConvertPacket(&test_packet_)); 96 EXPECT_FALSE(converter.ConvertPacket(&test_packet_));
97 97
98 // Uninject mock filter instance to avoid cleanup code on destruction of 98 // Uninject mock filter instance to avoid cleanup code on destruction of
99 // converter. 99 // converter.
100 converter.stream_filter_ = NULL; 100 converter.stream_filter_ = NULL;
101 } 101 }
102 102
103 TEST_F(BitstreamConverterTest, ConvertPacket_Success) { 103 TEST_F(BitstreamConverterTest, ConvertPacket_Success) {
104 FFmpegBitstreamConverter converter(kTestFilterName, &test_stream_context_); 104 FFmpegBitstreamConverter converter(kTestFilterName, &test_stream_context_);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 EXPECT_EQ(kData1, test_packet_.data); 154 EXPECT_EQ(kData1, test_packet_.data);
155 EXPECT_EQ(kTestSize1, test_packet_.size); 155 EXPECT_EQ(kTestSize1, test_packet_.size);
156 EXPECT_TRUE(test_packet_.destruct == NULL); 156 EXPECT_TRUE(test_packet_.destruct == NULL);
157 157
158 // Uninject mock filter instance to avoid cleanup code on destruction of 158 // Uninject mock filter instance to avoid cleanup code on destruction of
159 // converter. 159 // converter.
160 converter.stream_filter_ = NULL; 160 converter.stream_filter_ = NULL;
161 } 161 }
162 162
163 } // namespace media 163 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/bitstream_converter.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698