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

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

Issue 9317096: Fix media code to work with new ffmpeg. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix years. Created 8 years, 10 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/ffmpeg_glue.cc ('k') | media/filters/ffmpeg_video_decoder.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) 2012 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/logging.h" 5 #include "base/logging.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "media/base/mock_filters.h" 7 #include "media/base/mock_filters.h"
8 #include "media/ffmpeg/ffmpeg_common.h" 8 #include "media/ffmpeg/ffmpeg_common.h"
9 #include "media/filters/ffmpeg_glue.h" 9 #include "media/filters/ffmpeg_glue.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 // Prepare FFmpeg URLContext structure. 148 // Prepare FFmpeg URLContext structure.
149 URLContext context; 149 URLContext context;
150 memset(&context, 0, sizeof(context)); 150 memset(&context, 0, sizeof(context));
151 151
152 // Test opening a URLContext with a protocol that doesn't exist. 152 // Test opening a URLContext with a protocol that doesn't exist.
153 EXPECT_EQ(AVERROR(EIO), protocol_->url_open(&context, "foobar", 0)); 153 EXPECT_EQ(AVERROR(EIO), protocol_->url_open(&context, "foobar", 0));
154 154
155 // Test opening a URLContext with our protocol. 155 // Test opening a URLContext with our protocol.
156 EXPECT_EQ(0, protocol_->url_open(&context, key.c_str(), 0)); 156 EXPECT_EQ(0, protocol_->url_open(&context, key.c_str(), 0));
157 EXPECT_EQ(URL_RDONLY, context.flags); 157 EXPECT_EQ(AVIO_FLAG_READ, context.flags);
158 EXPECT_EQ(protocol.get(), context.priv_data); 158 EXPECT_EQ(protocol.get(), context.priv_data);
159 EXPECT_TRUE(context.is_streamed); 159 EXPECT_TRUE(context.is_streamed);
160 160
161 // We're going to remove references one by one until the last reference is 161 // We're going to remove references one by one until the last reference is
162 // held by FFmpeg. Once we close the URLContext, the protocol should be 162 // held by FFmpeg. Once we close the URLContext, the protocol should be
163 // destroyed. 163 // destroyed.
164 InSequence s; 164 InSequence s;
165 EXPECT_CALL(*this, CheckPoint(0)); 165 EXPECT_CALL(*this, CheckPoint(0));
166 EXPECT_CALL(*this, CheckPoint(1)); 166 EXPECT_CALL(*this, CheckPoint(1));
167 EXPECT_CALL(*protocol, OnDestroy()); 167 EXPECT_CALL(*protocol, OnDestroy());
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 // Remove our own reference, we shouldn't be destroyed yet. 315 // Remove our own reference, we shouldn't be destroyed yet.
316 CheckPoint(0); 316 CheckPoint(0);
317 protocol.reset(); 317 protocol.reset();
318 318
319 // ~FFmpegGlue() will be called when this unit test finishes execution. By 319 // ~FFmpegGlue() will be called when this unit test finishes execution. By
320 // leaving something inside FFmpegGlue's map we get to test our cleanup code. 320 // leaving something inside FFmpegGlue's map we get to test our cleanup code.
321 } 321 }
322 322
323 } // namespace media 323 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_glue.cc ('k') | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698