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

Unified Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 8304020: Fix Valgrind warnings from r105646. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer_unittest.cc
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
index dcf5743d5b7002f6ba65d9b31eb003dbc7a493bd..231314de8c5edba4832447229b673008a0756353 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -36,6 +36,10 @@ MATCHER(IsEndOfStreamBuffer,
return arg->IsEndOfStream();
}
+ACTION(DeleteArg0Buffer) {
+ scoped_refptr<Buffer> buffer(arg0);
+}
+
// Fixture class to facilitate writing tests. Takes care of setting up the
// FFmpeg, pipeline and filter host mocks.
class FFmpegDemuxerTest : public testing::Test {
@@ -403,7 +407,8 @@ TEST_F(FFmpegDemuxerTest, Stop) {
// The callback should be immediately deleted. We'll use a checkpoint to
// verify that it has indeed been deleted.
- EXPECT_CALL(*callback, Run(NotNull()));
+ EXPECT_CALL(*callback, Run(IsEndOfStreamBuffer()))
scherkus (not reviewing) 2011/10/17 17:59:18 Woah -- we shouldn't have to do this considering i
+ .WillOnce(DeleteArg0Buffer());
EXPECT_CALL(*callback, OnDelete());
EXPECT_CALL(*this, CheckPoint(1));
@@ -442,7 +447,8 @@ TEST_F(FFmpegDemuxerTest, StreamReadAfterStopAndDemuxerDestruction) {
// The callback should be immediately deleted. We'll use a checkpoint to
// verify that it has indeed been deleted.
- EXPECT_CALL(*callback, Run(IsEndOfStreamBuffer()));
+ EXPECT_CALL(*callback, Run(IsEndOfStreamBuffer()))
+ .WillOnce(DeleteArg0Buffer());
EXPECT_CALL(*callback, OnDelete());
EXPECT_CALL(*this, CheckPoint(1));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698