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

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

Issue 10822024: Don't clear the list of source buffers in ChunkDemuxer::Shutdown() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for mem leak Created 8 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/chunk_demuxer.cc ('k') | no next file » | 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) 2012 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/bind.h" 5 #include "base/bind.h"
6 #include "media/base/audio_decoder_config.h" 6 #include "media/base/audio_decoder_config.h"
7 #include "media/base/decoder_buffer.h" 7 #include "media/base/decoder_buffer.h"
8 #include "media/base/mock_callback.h" 8 #include "media/base/mock_callback.h"
9 #include "media/base/mock_demuxer_host.h" 9 #include "media/base/mock_demuxer_host.h"
10 #include "media/base/test_data_util.h" 10 #include "media/base/test_data_util.h"
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 898
899 // Test cases where we get an EndOfStream() call during initialization. 899 // Test cases where we get an EndOfStream() call during initialization.
900 TEST_F(ChunkDemuxerTest, TestEOSDuringInit) { 900 TEST_F(ChunkDemuxerTest, TestEOSDuringInit) {
901 EXPECT_CALL(*client_, DemuxerOpened(_)); 901 EXPECT_CALL(*client_, DemuxerOpened(_));
902 demuxer_->Initialize( 902 demuxer_->Initialize(
903 &host_, NewExpectedStatusCB(DEMUXER_ERROR_COULD_NOT_OPEN)); 903 &host_, NewExpectedStatusCB(DEMUXER_ERROR_COULD_NOT_OPEN));
904 demuxer_->EndOfStream(PIPELINE_OK); 904 demuxer_->EndOfStream(PIPELINE_OK);
905 } 905 }
906 906
907 TEST_F(ChunkDemuxerTest, TestEndOfStreamWithNoAppend) { 907 TEST_F(ChunkDemuxerTest, TestEndOfStreamWithNoAppend) {
908 EXPECT_CALL(*client_, DemuxerOpened(_));
909 demuxer_->Initialize(
910 &host_, NewExpectedStatusCB(DEMUXER_ERROR_COULD_NOT_OPEN));
911
912 ASSERT_EQ(AddId(), ChunkDemuxer::kOk);
913
914 CheckExpectedRanges("{ }");
915 demuxer_->EndOfStream(PIPELINE_OK);
916 ShutdownDemuxer();
917 CheckExpectedRanges("{ }");
918 demuxer_->RemoveId(kSourceId);
919 demuxer_ = NULL;
920 }
921
922 TEST_F(ChunkDemuxerTest, TestEndOfStreamWithNoMediaAppend) {
908 ASSERT_TRUE(InitDemuxer(true, true, false)); 923 ASSERT_TRUE(InitDemuxer(true, true, false));
909 924
910 CheckExpectedRanges("{ }"); 925 CheckExpectedRanges("{ }");
911 demuxer_->EndOfStream(PIPELINE_OK); 926 demuxer_->EndOfStream(PIPELINE_OK);
912 CheckExpectedRanges("{ }"); 927 CheckExpectedRanges("{ }");
913 } 928 }
914 929
915 TEST_F(ChunkDemuxerTest, TestDecodeErrorEndOfStream) { 930 TEST_F(ChunkDemuxerTest, TestDecodeErrorEndOfStream) {
916 ASSERT_TRUE(InitDemuxer(true, true, false)); 931 ASSERT_TRUE(InitDemuxer(true, true, false));
917 932
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
1795 1810
1796 GenerateExpectedReads(0, 4, audio, video); 1811 GenerateExpectedReads(0, 4, audio, video);
1797 GenerateExpectedReads(46, 66, 5, audio, video); 1812 GenerateExpectedReads(46, 66, 5, audio, video);
1798 1813
1799 EndOfStreamHelper end_of_stream_helper(demuxer_); 1814 EndOfStreamHelper end_of_stream_helper(demuxer_);
1800 end_of_stream_helper.RequestReads(); 1815 end_of_stream_helper.RequestReads();
1801 end_of_stream_helper.CheckIfReadDonesWereCalled(true); 1816 end_of_stream_helper.CheckIfReadDonesWereCalled(true);
1802 } 1817 }
1803 1818
1804 } // namespace media 1819 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698